PHP Sessions
Posted: Thu Jul 28, 2005 9:54 am
Hi!!
I have a program that in the first page has a text box, and a submit button,in the second page I call the text box called var in PHP and I make it a Variable session, and in the third page I call such variable, but it says it is undefined, the session_start() is already put in the first page. The funny thing is that in works only for some computers.
CODE first page:
2 page:
3 page:
Hope someone can help me!! Thanks in advance!!
I have a program that in the first page has a text box, and a submit button,in the second page I call the text box called var in PHP and I make it a Variable session, and in the third page I call such variable, but it says it is undefined, the session_start() is already put in the first page. The funny thing is that in works only for some computers.
CODE first page:
Code: Select all
<form name="form1" method="post" action="2.php">
<?php
print_r($_SESSION);
?>
<p>
<input name="var" type="text" id="var" size="20" maxlength="20">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>Code: Select all
<form name="form1" method="post" action="3.php">
<?php
$_SESSION['var']=$_POST['var'];
echo "pag inter", "<br>";
print_r($_SESSION);
?>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>Code: Select all
<form name="form1" method="post" action="1.php">
<?php
echo $var=$_SESSION['var'];
print_r($_SESSION);
?>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>