|
Posted by Jerry Stuckle on 10/07/26 11:27
Joseph S. wrote:
> Hi,
>
>>How about placing it in the $_SESSION array? Start the session at the
>>beginning of the page and store $s in $_SESSION['s']. Then pull it out
>>on the second call. (Be sure to clear $_SESSION['s'] on first call to
>>the page).
>
>
> I did that, the value of $s is getting stored properly in
> $_SESSION['s'], but in the second load of the page, $_SESSION['s'] is
> not showing in the case '2' code.
>
> Either script does not hav e access to $_SESSION or values held in
> $_SESSION are removed. Does PHP give an invalid index error in the case
> that I access $_SESSION['s'] and $_SESSION does not have an 's'
> element?
> I am asking this because, it is giving no such error, probably meaning
> that the $_SESSION array has 's' but the value is getting cleaned.
>
> also, in the case '2' code,
> print_r($_SESSION);
> outputs nothing at all!
>
> Also, I have tried -
> session_name("samplesession");
> session_start();
> in the case '1' code at the start.
>
> But in the case '2' code,
> a session_is_registered("samplesession"); gives a FALSE.
>
> I have register_globals=On in my php.ini.
>
>
> Any other function needs to be used?
>
>
> Joseph S.
>
First of all, you should never have register_globals set to on. It's a
huge security risk.
As to the session variables not working. They work fine for me.
However, without seeing your entire code, it's almost impossible to
determine why sessions are failing.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|