basic php problem
| From: | Ross | Date: | Thu, 15 Jun 2006 13:11:49 +0000 |
| Subject: | basic php problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-238085@lists.php.net to get a copy of this message | ||
I want to set a page number of a page
if(!isset($_REQUEST['page'])) {
$page =$_REQUEST['page'] + 1;
echo "page is ".$page; // this echos out page is 1
}
The problem is when I try and use $page further down in the body $page is 0
Question <?=$page; ?> <BR />
<? echo "page is".$page; ?>
<?=$question[($page-1)]; ?>
I also get an undefined index notice
Notice: Undefined index: page in
c:\Inetpub\wwwroot\lss\module_one\evaluation.php on line 8
page is 1
but I though if I do a if(!isset($_REQUEST['page'])) this is the way to set
a previously undefined index?
Ross