Re: basic php problem

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

 



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), $MAX_PAGE);

Dante

--
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