Server Setup

Hello all. I have sucesfully setup a server on my home computer with PHP, MySQL, and Apache. I am having one problem with everything though, It seems to come into affect when I use $_POST or $PHP_SELF

Register_Globals are on.

Notice: Undefined index: message in c:program filesapache groupapachehtdocsblanchardriveradminminutes.php on line 33

I get this message every single time a $_POST is called or a $PHP_SELF is called.

any ideas?

(Sorry for posting this in here… didn’t think any other cat fit either. Thanks)

Check your error reporting, you need to turn down the reporting only to show errors opposed to warnings

because $_POST is actually an ARRAY (of super globals), you specified an INDEX that was NOT in the array (thus Undefined). You can do as Miles has suggested and lower the error reporting level. I personally like the error repoting on so I can resolve ALL errors (or try to anyway).

I use the following:

$var = !empty($_POST[‘var’]) ? $_POST[‘var’] : ‘’ ;

// the above is the same as below
If (!empty($_POST[‘var’])) {
$var = $_POST[‘var’];
} else {
$var = ‘’;


This resolve the error (that might only be a “Sometimes” error) and initialize a local variable for you. Whenever I POST or GET variables, this is one of the first things I do.

Good luck, hope this helps.

Sponsor our Newsletter | Privacy Policy | Terms of Service