Re: [PHP] Warning: Undefined Index?

2002-07-03 Thread 1LT John W. Holmes

> // Message on my web page
> Warning: Undefined index: mode in /var/www/html/inc/header.php on line 3
>
> // My Script Here
> 1:  2: // These are globals on every page
> 3: $mode = $_GET['mode'];
> 4: $si_uuid = $_GET['si_uuid'];
> 5: $po_uuid = $_GET['po_uuid'];

PHP is warning you that 'mode' is not an index of $_GET. So whatever text
box or check box or whatever that was supposed to set 'mode', didn't. You
should check that $_GET['mode'] is set before you attempt to capture it's
value.

if(isset($_GET['mode'])
{ $mode = $_GET['mode'];}
else
{ $mode = "default"; }

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Warning: Undefined Index?

2002-07-03 Thread David Busby

List,
I'm getting this error and I don't know why...can someone please help out?

// Message on my web page
Warning: Undefined index: mode in /var/www/html/inc/header.php on line 3

// My Script Here
1: http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php