Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I have 2 php scripts. The first one sets a value in a session variable and the 2nd displays it. Page1 has the hyperlink for page2.
The code is tested and works fine on my local machine and also on my other server but it is not at all working on one server. I don't whats wrong with that server because I compared all php settings with my other servers and its all same for the sessions, but its not working.
Here is the code:
===================
Page1 :Code: Select all
<?php
session_start();
$_SESSION['var']='my variable';
?>
<a href='page2.php'>Page 2</a>Page 2:
Code: Select all
<?php
session_start();
echo $_SESSION['var'];
?>Please help me out as I couldn't figure what the actual cause of this problem. The same script is working everywhere else.
Regards,
Fakhri.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]