You are here: Re: retrieving data from session id?? « All PHP « IT news, forums, messages
Re: retrieving data from session id??

Posted by Shelly on 08/15/06 10:34

<crescent_au@yahoo.com> wrote in message
news:1155622217.002064.121000@75g2000cwc.googlegroups.com...
> 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

Try adding to all pages at the top in the php area:

session_start();

Shelly

 

Navigation:

[Reply to this 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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация