$_POST not returning value

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

$_POST not returning value

Post 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.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

try:

Code: Select all

print_r($_POST);
that will show you the entire post array with the key/value pairs.
bdlang
Forum Contributor
Posts: 395
Joined: Tue May 16, 2006 8:46 pm
Location: Ventura, CA US

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: $_POST not returning value

Post 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>
(#10850)
Post Reply