Notice: Undefined index: ???

Started on the old forum in May 2009 · view the original in the archive · old links redirect here

2 replies · 707 views · started 17 years ago · 1 min read

2 participants
metulj Super moderator Principal · 1,726 posts #1

this is error which i get displayed on site

Notice:  Undefined index:  submit in C:\server\www\mz\somesetup.php on line 40

line 40 is like this:

{    if($_POST['submit'])/// <= this is line 40
echo "<body>";
...........................................................
...................... some code..................
..........................................................
echo "<form action=\"\" method=\"post\">";
echo "<br/>";
echo "<input type=\"submit\" value=\"[INSTALL]\"/>";
echo "</form>";
echo "</body>";
echo "</html>";
die();

so, whats wrong with that 'submit' in line 40 ? or with other words... how to write this code properly?

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

capofret Developer · 225 posts #2

from google. lol:p

This error appears because of your PHP error reporting settings. Usually, it appears when your variable is not properly set. There are two ways to handle this issue:

  1. Check if $_POST['action'] is set before using it. For example:

if (!isset($_POST['action'])) { //If not isset -> set with dumy value $_POST['action'] = "undefine"; }

  1. Suppress Notice warnings

Notice warnings could be suppressed by changing the error_reporting variable in your PHP.ini. error_reporting could be set to show all errors except those for notices and coding standards warnings: error_reporting = E_ALL & ~E_NOTICE

The same is accomplished by adding the following line in your php page:

<?php error_reporting (E_ALL ^ E_NOTICE); ?>

it may be your ($_POST['submit'])

LDSWAPWORLD site closed. im busy with other things in life like facebook , send me PM so i can add you 🙂 www.pinoySG.com

don't ask for help if you're not even helping yourself! i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.

External image (may be gone)

metulj Super moderator Principal · 1,726 posts #3

capofret wrote: from google. lol:p This error appears because of your PHP error reporting settings. Usually, it appears when your variable is not properly set. There are two ways to handle this issue:

  1. Check if $_POST['action'] is set before using it. For example: if (!isset($_POST['action'])) { //If not isset -> set with dumy value $_POST['action'] = "undefine"; }
  2. Suppress Notice warnings Notice warnings could be suppressed by changing the error_reporting variable in your PHP.ini. error_reporting could be set to show all errors except those for notices and coding standards warnings: error_reporting = E_ALL & ~E_NOTICE The same is accomplished by adding the following line in your php page:
<?php error_reporting (E_ALL ^ E_NOTICE); ?>

it may be your ($_POST['submit'])

ahhh LMAO stupid me! i've deleted wrong line in code... where value for

($_POST['submit'])

was set... i just couldnt notice that lmao all ok now 🙂 tnx

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close