English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

im getting this error anybody knows y?

Notice: Undefined index: submit in /www/1111mb.com/a/r/y/aryaxt/htdocs/register.php on line 2

and i have this if statement in line 2
if ($_POST['submit'])

2007-01-01 08:02:01 · 2 answers · asked by aryaxt 3 in Computers & Internet Programming & Design

2 answers

from what i can tell you shoudln't be getting that.. might be something in your php.ini

for workaround try:
if ( isset ( $_POST['submit'] ) )

2007-01-01 08:09:32 · answer #1 · answered by Brady 3 · 0 0

That error occurs when your error_reporting setting is set to include errors of type E_NOTICE. In older PHP versions the default configuration excluded these types of errors, but in the push toget PHP developers to write better (more secure) code, the default setting was changed in PHP 5 (and possibly in some newer PHP 4 distros as well).

What it is saying is that the 'submit' index of the $_POST variable has not been defined. Technically all variables should be defined (by setting some value to them) before they are checked.

There are several solutions to the problem. Here are a few, starting with the best solution and decending from there:

1. Do as the last poster suggests: if(isset($_POST['submit'))

2. Surpress the error message with the "@" operator: if(@$_POST['submit'])

3. Change the error reporting settings for current script by adding to show all errors except notices by adding this to the top of your script:
error_reporting(E_ALL ^ E_NOTICE);

4. If you are using Apache and mod_php, add this line to your an .htaccess file to change the setting in all scripts in the directory and any directory below it:
php_value error_reporting "E_ALL ^ E_NOTICE"

5. Change the error reporting for all PHP scripts on the server by editing the error_reporting line of your php.ini, if you have access to it:
error_reporting = E_ALL ^ E_NOTICE

Hope this helps.

2007-01-05 05:30:24 · answer #2 · answered by webmaster_kodiak 1 · 0 0

fedest.com, questions and answers