Re: basic php problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



nicolas figaro a écrit :
Ross a écrit :
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)]; ?>

2nd try (did I miss the question at first try ?)
$page is local to your curly brackets if it's not used upper in your code.
try to put "$page = 0; " before the if statement.

N F

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux