Question: I have a full working php script for user activation that I wrote. Fully working in a sense that it displays no errors while on my actual web hosting, although when I am working in WAMP2 I get errors such as these.

```
Notice: Undefined index: type in C:\wamp\www\activate.php on line 4
Notice: Undefined index: username in C:\wamp\www\activate.php on line 5
Notice: Undefined index: gender in C:\wamp\www\activate.php on line 6
Notice: Undefined index: formvalue in C:\wamp\www\activate.php on line 29

```

I know what the problem is, it is because the page activation.php is both for the form submission from create.php (the form on create.php has a hidden value of 1 and if it exists then the form is submitted into the mysql db) and if the form value is not present then the user is activating their account.

When the user is activating, the variables that I have defined using $\_POST and the hidden form value of 1 are not defined which is causing the errors. 

My question is why are these errors not displayed when my pages are loaded on my actual hosting but are present in WAMP2? And do these errors matter, is it bad practice to have undefined variables? And if so how do I overcome the problem?

Thanks and I hope I explained that all ok.

Answer: 
Your PHP is configured to show Notices, Warnings etc. on your WAMP2 configuration.

In the hosting environment this is disabled, and will probably only show critical errors.

You can find out more about error reporting : <http://forums.devshed.com/php-development-5/changing-error-reporting-in-php-ini-549798.html>

If you don't know where your php.ini file is, try to create a php file with the following code to show current configuration:

```
<?php
   phpinfo();
?>

```
Your host has most likely error\_reporting set to a value in which E\_NOTICE's are not shown (E\_ALL ^ E\_NOTICE). I always check the existence of my variables, so no notices on undefined variables / indices are thrown. That aids me in debugging, in which I always enable E\_NOTICE (error\_reporting = E\_ALL).

You may want to use the `filter_*` methods for getting POST or GET values because it also checks whether a submitted value is a string or not.