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

Posted by Petr Vileta on 08/15/06 12:41

<crescent_au@yahoo.com> píse v diskusním príspevku
news:1155622217.002064.121000@75g2000cwc.googlegroups.com...
> Hi all,
>
> Please help me out here.
>
> Am I missing something?
>
Yes ;-) You must start session on each page where you want set or get
session infos and close it.

on Page A:
<?php
session_start(); // THIS IS IMPORTANT
<a href="<?php echo 'pageB.php?item=docs&sSID='.session_id();
session_write_close(); // THIS IS IMPORTANT TOO
?>">Docs</a>

on PageB:
<?php
session_start(); // THIS IS IMPORTANT
if ($sSID) {
echo $_SESSION['username']; // THIS IS WHAT I WANT TO READ HERE
....
session_write_close(); // THIS IS IMPORTANT TOO
?>
--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)

 

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

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