Re: basic php problem
| From: | D. Dante Lorenso | Date: | Thu, 15 Jun 2006 15:49:46 +0000 |
| Subject: | Re: basic php problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238105@lists.php.net to get a copy of this message | ||
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