Posted: Fri Oct 05, 2007 7:44 am
feyd | Please use
Code for page2:
===========
OUTPUT OF PAGE 1:
==============
This value is stored in a session variable and should be carried to the page2.
Click to go to page2
OUTPUT OF PAGE 2:
==============
Page2 :
Session Value:
Notice: Undefined variable: _SESSION in /home/dragonf/public_html/dragonfeed/page2.php on line 15
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]
Following is the code for page1:Code: Select all
<?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>===========
Code: Select all
<?php
session_start();
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
?>
<html>
<head>
<title>Page 2</title>
</head>
<body>
<p>Page2 :</p>
<p>
<strong>Session Value:</strong>
<?=$_SESSION['var'];?>
</p>
</body>
</html>==============
This value is stored in a session variable and should be carried to the page2.
Click to go to page2
OUTPUT OF PAGE 2:
==============
Page2 :
Session Value:
Notice: Undefined variable: _SESSION in /home/dragonf/public_html/dragonfeed/page2.php on line 15
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]