Re: Warning: Undefined Index?
| From: | 1LT John W. Holmes | Date: | Wed, 03 Jul 2002 20:52:13 +0000 |
| Subject: | Re: Warning: Undefined Index? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-105291@lists.php.net to get a copy of this message | ||
> // Message on my web page
> Warning: Undefined index: mode in /var/www/html/inc/header.php on line 3
>
> // My Script Here
> 1: <?php
> 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...