On Thu, June 15, 2006 8:11 am, Ross wrote:
> I want to set a page number of a page
>
> if(!isset($_REQUEST['page'])) {
> $page =$_REQUEST['page'] + 1;
These two together make no sense at all...
If the $_REQUEST['page'] is NOT set, then why use it? It's NOT THERE.
> echo "page is ".$page; // th
Dave Goodchild wrote:
if $_REQUEST['page'] is not set, why not do this:
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
(ternary operator)
// test, numeric read, with default and bounds checking
$page = empty($_REQUEST['page']) ? 1 : intval($_REQUEST['page']);
$page = min(max($page, 1
On 15/06/06, Ross <[EMAIL PROTECTED]> wrote:
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
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
2nd
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
I also get an undefined index no
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
I also get an undefined index notice
Notice: Un
6 matches
Mail list logo