Reply to Re: retrieving data from session id??

Your name:

Reply:


Posted by Jahjah92 on 08/15/06 10:36

hi,
before trying to retrieve values in $_SESSION , you have to call
session_start() , and php will fill the array of session.
A+

"m2m tech" <tech@m2m.at> a ιcrit dans le message de news:
44e18226$0$10480$91cee783@newsreader01.highway.telekom.at...
> You have to tell PageB to do something with the session created by PageA.
> For example:
>
> session_id ($_GET['sSID'])
>
> but be shure to clean sSID before you use it like this ...
>
>
>
> crescent_au@yahoo.com wrote:
>
>> Hi all,
>>
>> Please help me out here.
>>
>> This is what I have done:
>>
>> on Page A:
>> <a href="<?php echo 'pageB.php?item=docs&sSID='.session_id();
>> ?>">Docs</a>
>>
>> on PageB:
>> <?php
>> if ($sSID) {
>> echo $_SESSION['username']; // THIS IS WHAT I WANT TO READ HERE
>> switch($_REQUEST['item']) {
>> case "docs": echo "doc files"; break;
>> case "reqdocs": echo "other files"; break;
>> case "misc": echo "miscellaneous files"; break;
>> default: echo "Invalid query"; break;
>> }
>> }
>> ?>
>>
>> As you can see on PageB, I tried to read the value of
>> $_SESSION['username'] but it gives nothing. The session file is
>> correctly created in my /tmp folder with the username field containing
>> valid data.
>>
>> Am I missing something? Thanks
>> Ben
>>
>
>
> --
> --------------------------------------------
> m2m server software gmbh - http://www.m2m.at

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация