Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sessions with W2K Pro & Apache

Status
Not open for further replies.

FurryGorilla

Technical User
Apr 11, 2001
76
GB
Hi

I've et up Apache 1.3, MySQL and PHP on a W2K Pro PC but am having problems using sessions to pass data between pages. I've checked the php.ini file and it has the following format:

Code:
[session]
session.save_path = c:\tmp

The test pages I'm running are as follows:

page1.php
Code:
<?
  session_start();
  session_register(&quot;sess_var&quot;);
  $sess_var = &quot;Hello world!&quot;;

  echo &quot;The content of \$sess_var is $sess_var<br>&quot;;
?>
<a href = &quot;page2.php&quot;>Next page</a>
page2.php
Code:
<?
  session_start();

  echo &quot;The content of \$sess_var is $sess_var<br>&quot;;

  session_unregister(&quot;sess_var&quot;);
?>
Unfortunately when I go to page2.php after clocking on the hyperlink from page1.php, the $sess_var value does not appear.

There is a file in the c:\temp directory called sess_f75aecf8c9fb286bb6e4e8205238658d which I presume is where the session information is stored.

Any ideas?

Many thanks
Chris Have you seen my munkee? [monkey]
 
Oops, figured it out [afro]

Forgot to turn on register_globals in the php.ini file. Have you seen my munkee? [monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top