Jump to content

[SOLVED] Need Session Help


christofurr

Recommended Posts

Just started studying PHP sessions a few minutes ago. I created three small pages to test a session.

 

The first - sessiontest1.php5 :

 

<html>
<body>
<form action="sessiontest2.php5" method="post">
<input type="text" name="A" />
<input type="submit" />
</form>
</body>
</html>

 

The second - sessiontest2.php5 :

 

<?php
session_start();
$_SESSION['A']=$_POST['A'];
?>

<html>
<body>
<?php echo $_SESSION["A"]; ?>
<p><a href="http://www.froobscape.com/sessiontest3.php5">TEST</a></p>
</body>
</html>

 

The third - sessiontest3.php5 :

 

<html>
<body>
<?php echo $_SESSION["A"]; ?>
</body>
</html>

 

Why doesn't the third echo the form input?

Link to comment
Share on other sites

i'll also point out that you don't necessarily need to name your pages .php5.  .php suffices these days.

 

That would highly depend upon the server. Allot of places are offering support for php4 and php5 and file extensions are a good way to handle this.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.