why values not remembered by php?
| From: | Sonia Tsui | Date: | Wed, 23 Aug 2000 00:10:05 +0000 |
| Subject: | why values not remembered by php? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-13046@lists.php.net to get a copy of this message | ||
Here is the sample code
(main.php)
<?php
$start = $end;
$end = $start + 3;
?>
<html>
......
<a href ="main.php" ....>nextbutton</a>
<?php
for ($i = $start; $i<$end; $i++) {
echo("i: $i<br>");
}
?>
</html>
-------------------------------------------------------------------------
so when <next button> is pressed, it comes back to this page. What I don't
understand is why $end is not remembered? I though variable exist for one
http transaction. I expect to see 0, 1, 2, 3 and then 4, 5, 6 etc. but I
just see 0,1,2,3 and then 0,1,2,3 again and again. Can anyone help with my
simple question?
---Sonia