On Wed, 2003-06-11 at 12:22, Ryan M wrote:
> Thanks for the advice... The link worked.... Now it is saying this:
>
> Notice: Undefined index: action in....
>
> It only says this if there is no action...it goes away once I click the link
> and the action=someaction.... Is there a way to fix my php so that I dont
> have to change all of the web sites hosted on my server?? Thanks!
>
> Ryan
Check and initialize your input variables:
if (!isset($_GET['action'])) {
$action = '';
} else {
$action = $_GET['action'];
}
switch ($action) {
case 'something':
do_something();
break;
case 'something_else':
do_something_else();
break;
default:
echo "Unrecognized action given";
break;
}
If this is something you need to do for every page on your site, put
the if() check into an auto-prepended file or something.
Hope this helps,
Torben
--
Torben Wilson <[EMAIL PROTECTED]> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php