New to PHP
From: Rick (rick_at_di-wave.com)
Date: 03/07/05
- Next message: jiing: "how to php on FreeBSD has the ability to access mySQL?"
- Previous message: david best: "Where can I get fileinfo.so"
- Next in thread: Derek Scales: "Re: New to PHP"
- Reply: Derek Scales: "Re: New to PHP"
- Reply: John: "Re: New to PHP"
- Reply: DH: "Re: New to PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 07 Mar 2005 15:56:41 GMT
I am having a problem using session verables. I have set up 3 pages for
testing the code is below. The verable displays on page two but not one page
three. Any ideas why?
Thanks for any help you can give!!! I know I am going to feel really stupid
when someone tells me why this is not working but I guess that is the way
you learn.
Thanks You!
Rick
First file
test.php
//*********** Start Here
<?php
session_start();
header("Cache-control: private"); // IE 6 Fix.
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<FORM METHOD="POST" ACTION="test2.php">
Enter your Name: <input type="text" name="name">
<input type="SUBMIT" value="Submit">
</FORM>
</body>
</html>
Second file
test2.php
//*********** Start Here
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
// start the session
session_start();
//header("Cache-control: private"); //IE 6 Fix
// Get the user's input from the form
$name = $_POST['name'];
// Register session key with the value
$_SESSION['name'] = $name;
// Display the sssion information:
?>
Welcome to my website <strong><? echo $_SESSION['name']; ?></strong>!<br />
Let's see what happens on the next page.<br /><br />
</body>
</html>
Third file
test3.php
//*********** Start Here
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Welcome to my website <strong><?php echo $_SESSION['name']; ?></strong>
</body>
</html>
- Next message: jiing: "how to php on FreeBSD has the ability to access mySQL?"
- Previous message: david best: "Where can I get fileinfo.so"
- Next in thread: Derek Scales: "Re: New to PHP"
- Reply: Derek Scales: "Re: New to PHP"
- Reply: John: "Re: New to PHP"
- Reply: DH: "Re: New to PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|