Re: [PHP] basic php problem

2006-06-15 Thread Richard Lynch
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

Re: [PHP] basic php problem

2006-06-15 Thread D. Dante Lorenso
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

Re: [PHP] basic php problem

2006-06-15 Thread Dave Goodchild
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

Re: [PHP] basic php problem

2006-06-15 Thread nicolas figaro
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

Re: [PHP] basic php problem

2006-06-15 Thread nicolas figaro
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

[PHP] basic php problem

2006-06-15 Thread Ross
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