[PHP] Re: Sessions nightmare continue...SOLVED

2004-08-17 Thread Angelo Zanetti
Thanks to all that responded, I have finally found the problem:

When I installed PHP again, I kept on modifying the PHP.ini in the
WINNT directory (as specified in the manual) but the PHP.ini that was
being looked up was the 1 in the c:\php directory so I kept on trying
all new things and nothing worked. 

Thanks again. Please remeber so that you dont make the same mistake as
me

Angelo

>>> "Craig Donnelly" <[EMAIL PROTECTED]> 8/17/2004 12:04:42 PM
>>>
Why are you testing if $_POST['submit'] is set are you posting
something to
the page??

In the two scripts you posted the code block wont be executed because
there
is no post variable
being set.

Try this:

a1.php
==
   


 

==

AND

a2.php
==
session variable NOT set");
 }else{
  echo("session variable set");
 }

 echo("session ID: " . session_id());
 echo("session value: " . $_SESSION["login"]);
?>


 

==

Works fine now.

HTH

Craig


"Angelo Zanetti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> Still no luck with sessions. I have installed an older version:
4.3.1
> and have register_globals=Off
>
> I have 2 test pages a1.php and a2.php
>
> All I want to do is register a session variable, set a value for it
and
> then in a2.php check that it is still registered and view the
session's
> value.
>
> a1.php:
>
>  session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(isset($_POST['Submit']))
> {
> $_SESSION["login"]="inside";
> session_write_close();
> header("Location: a2.php");
> exit();
> }
> ?>
>
>
> I can successfully register the session variable and set the value
of
> it on page a1.php but when I go to page a2.php the session variable
is
> not set and the value isnt set either.
>
> a2.php:
>
>  session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(!isset($_SESSION["login"]))
>echo("session variable NOT set");
> else
> echo("session variable set");
>
> echo("session ID: " . session_id());
> echo("session value: " . $_SESSION["login"]);
>
> ?>
>
> I have been trying to get this to work for ages with no luck. I have
> been reading the manual and have googled and cant seem to find the
> problem. if anyone can help that would be great.
>
> thanks in advance
> Angelo
> 
> Disclaimer
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is
> intended for the attention and use only of the addressee.
> Should you have received this e-mail in error, please delete
> and destroy it and any attachments thereto immediately.
> Under no circumstances will the Cape Technikon or the sender
> of this e-mail be liable to any party for any direct, indirect,
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Sessions nightmare continue...

2004-08-17 Thread Craig Donnelly
Why are you testing if $_POST['submit'] is set are you posting something to
the page??

In the two scripts you posted the code block wont be executed because there
is no post variable
being set.

Try this:

a1.php
==
   


 

==

AND

a2.php
==
session variable NOT set");
 }else{
  echo("session variable set");
 }

 echo("session ID: " . session_id());
 echo("session value: " . $_SESSION["login"]);
?>


 

==

Works fine now.

HTH

Craig


"Angelo Zanetti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> Still no luck with sessions. I have installed an older version: 4.3.1
> and have register_globals=Off
>
> I have 2 test pages a1.php and a2.php
>
> All I want to do is register a session variable, set a value for it and
> then in a2.php check that it is still registered and view the session's
> value.
>
> a1.php:
>
>  session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(isset($_POST['Submit']))
> {
> $_SESSION["login"]="inside";
> session_write_close();
> header("Location: a2.php");
> exit();
> }
> ?>
>
>
> I can successfully register the session variable and set the value of
> it on page a1.php but when I go to page a2.php the session variable is
> not set and the value isnt set either.
>
> a2.php:
>
>  session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(!isset($_SESSION["login"]))
>echo("session variable NOT set");
> else
> echo("session variable set");
>
> echo("session ID: " . session_id());
> echo("session value: " . $_SESSION["login"]);
>
> ?>
>
> I have been trying to get this to work for ages with no luck. I have
> been reading the manual and have googled and cant seem to find the
> problem. if anyone can help that would be great.
>
> thanks in advance
> Angelo
> 
> Disclaimer
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is
> intended for the attention and use only of the addressee.
> Should you have received this e-mail in error, please delete
> and destroy it and any attachments thereto immediately.
> Under no circumstances will the Cape Technikon or the sender
> of this e-mail be liable to any party for any direct, indirect,
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php