PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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]
Following is the code for page1:
<?php
session_start();
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
$_SESSION['var']='This value is stored in a session variable and should be carried to the page2.';
?>
<html>
<head>
<title>Page 1</title>
</head>
<body>
<?=$_SESSION['var'];?>
<br />
Click to go to <a href="page2.php">page2</a>
</body>
</html>
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]
But as far as the code is concerned everything is fine. session_start() is also there and the permissions to the session save path is also OK. Then what could be the reason. I am amazed because sessions were working fine previously and suddenly it stopped working
Last edited by s.dot on Sat Oct 06, 2007 11:59 am, edited 1 time in total.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
I suspect it may be more simple. If this is being run on an Apache server, create an .htaccess file in the file's directory. In it, set error_reporting to E_ALL and display errors on. This way you don't have to set it in your files... and certain errors will display, because E_ALL in the code misses some errors which happen before the code begins parsing. http://php.net/configuration.changes for more details.
Rerun these scripts afterward. I suspect there's whitespace before the beginning of the code in the second file.