Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form submission does not work on MSIE

Status
Not open for further replies.

jimoblak

Instructor
Joined
Oct 23, 2001
Messages
3,620
Location
US
I have a really basic form (index.php) that works in at least Mac Safari and Windows Firefox & Opera. It does not work in Windows Internet Explorer. Suggestions are welcomed.

Code:
<form id="FormName" action="index.php" method="get" name="FormName"><button name="button" value="submitted" type="submit">Submit</button></form>

The same index.php file contains the following form processing:

Code:
<?php
if ($_GET[button]=="submitted") {
print ("submitted successfully");
}
?>

MSIE does not seem to recognize the button value and return the PHP result. Why?
 
IE submits a value. Just not the exact value you want.

The question is, do you want to check for a specific value, or do you want to check that the button was clicked and the form submitted?

If the latter, I recommend you actually check for the presence of the submitted value, not what the value is:

if (isset($_GET['button']))
{
print ('submitted successfully');
}



Want the best answers? Ask the best questions! TANSTAAFL!
 
Thanks for the info. It has fixed the problem but I am interested in further study. Is this an issue with PHP or MSIE? I am seeing ASP tutorials throughout the internet where the button's "value" is defined with different variables with no problem.

 
This is an MSIE problem. The values that PHP makes available in $_GET or $_POST are exactly what is reported by the browser.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top