Page 1 of 1

$_POST not returning value

Posted: Sat Jun 03, 2006 8:26 pm
by psychotomus
i Have

Code: Select all

<form name="form1" method="post" action="">
	  <input type="text" name="exploring"> 
	  # of turns to use to explore.
	  <br>
	  <input type="submit" name="Submit" value="   Explore   ">
	  <input type="image" name="Submit" src="undeserving.gif" alt="Test 1"
width="133" height="33" border="0" value="Test 1">
	  <input type="image" name="Submit" src="undeserving.gif" alt="Test 2"
width="133" height="33" border="0" value="Test 2">
	</form>

and print $_POST['Submit']; and it doesnt have no value for the image buttons.

Posted: Sat Jun 03, 2006 8:38 pm
by Burrito
try:

Code: Select all

print_r($_POST);
that will show you the entire post array with the key/value pairs.

Posted: Sat Jun 03, 2006 8:40 pm
by bdlang
  • You have three INPUT elements named 'Submit'. Not gonna work within the context of your script.
  • Just for the sake of argument, make sure your PHP version is > 4.1, when the $_POST superglobal was introduced.

Re: $_POST not returning value

Posted: Sat Jun 03, 2006 9:07 pm
by Christopher

Code: Select all

<form name="form1" method="post" action="">
	  <input type="text" name="exploring"> 
	  # of turns to use to explore.
	  <br>
	  <input type="submit" name="submit" value="   Explore   ">
	  <input type="image" name="test1" src="undeserving.gif" alt="Test 1"
width="133" height="33" border="0" value="Test 1">
	  <input type="image" name="test2" src="undeserving.gif" alt="Test 2"
width="133" height="33" border="0" value="Test 2">
	</form>