How to preserve value , this question so difficult
| From: | Thomas Edward Lawrence | Date: | Wed, 13 Aug 2003 18:52:53 +0000 |
| Subject: | How to preserve value , this question so difficult | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-21132@lists.php.net to get a copy of this message | ||
this is page1.php
<?
session_start() ;
echo $value ;
if (!session_is_registered("value") )
{
session_register("value") ;
$value = 1 ;
}
echo $value ;
?>
<br>
<a href="page2.php">Next page</a>
this is page2.php
<form method="POST" action="page1.php">
<?
session_start() ;
$value++ ;
echo $value ;
?>
<br>
<input type="submit" value="Submit" name="B1">
</form>
when I come back to page1.php from page2.php , this is result :
page1.php ( run at first time)
Warning: Cannot send session cookie - headers already sent by (output started at C:\PHP\page1.php:9)
in C:\PHP\\page1.php on line 10
Warning: Cannot send session cache limiter - headers already sent (output started at
C:\PHP\page1.php:9) in C:\PHP\page1.php on line 10
Notice: Undefined variable: value in C:\PHP\page1.php on line 11
1 (value of $value)
Next page
page2.php
Warning: Cannot send session cache limiter - headers already sent (output started at
C:\PHP\page2.php :10) in C:\PHP\page2.php on line 11
2 (value of $value)
page1.php ( when come back from page2.php)
Warning: Cannot send session cookie - headers already sent by (output started at C:\PHP\page1.php
:9) in C:\PHP\page1.php on line 10
Warning: Cannot send session cache limiter - headers already sent (output started at
C:\PHP\page1.php:9) in C:\PHP\page1.php on line 10
Notice: Undefined variable: value in C:\PHP\page1.php on line 11 (browser not understanding $value)
1 (value of $value still 1)
Next page
Nothing changes , value of $value still is 1 , this question is so difficult , I also want to ask
why my browser warns , how I must config in php.ini , I use IE6 , win2k , thank for reading .