Hi,
All I'm trying to do is check for the presence of a query string, but
everything I try gives me an Undefined Index error. I want to set a
variable $pagename to whatever was passed as the ?page= value, and if
it wasn't passed, set it to some default value.
http://www.mysite.com/index.php?page=hello
<?php
if (is_object($_REQUEST['page']))
$pagename = $_REQUEST['page'];
else
$pagename = "home";
?>
I also tried is_null, tried if($_REQUEST) by itself, also tried all of
these with $_GET, $_POST, $_GLOBAL, but they all give me Undefined
Index error on that If line.
- Brian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Re: [PHP] Need to check whether a param exists! Brian Dunning
- Re: [PHP] Need to check whether a param exists! 1LT John W. Holmes
- Re: [PHP] Need to check whether a param exists! Chris Shiflett
- Re: [PHP] Need to check whether a param exists... Brian Dunning
- Re: [PHP] Need to check whether a param exists! Chris Hayes