Hi there,
I have multiple PHP 4 scripts which set variables in the program similar to:
$r_admin_email = $_REQUEST["admin_email"];
where $_REQUEST["admin_email"]; is obviously passed in through a form.
However, there are times when this value is not passed along. Then the above assignment gives me the following warning:
Undefined index: admin_email in C:\Inetpub\cgi-bin\update_config.php on line 46
Besides turning off warnings, is there any way around this other than the following code:
if (array_key_exists ("admin_email", $_REQUEST)) {
$r_admin_email = $_REQUEST["admin_email"];
} else {
$r_admin_email = "";
}
???????????
I hate to have to do it the above way, because some of the scripts have over 50 variables that can be passed in.
Thanks!
I have multiple PHP 4 scripts which set variables in the program similar to:
$r_admin_email = $_REQUEST["admin_email"];
where $_REQUEST["admin_email"]; is obviously passed in through a form.
However, there are times when this value is not passed along. Then the above assignment gives me the following warning:
Undefined index: admin_email in C:\Inetpub\cgi-bin\update_config.php on line 46
Besides turning off warnings, is there any way around this other than the following code:
if (array_key_exists ("admin_email", $_REQUEST)) {
$r_admin_email = $_REQUEST["admin_email"];
} else {
$r_admin_email = "";
}
???????????
I hate to have to do it the above way, because some of the scripts have over 50 variables that can be passed in.
Thanks!