|
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
Hi,
I am having a big problem with PHP, I wish to submit a form to either 'Update' or 'Delete' a record, it works fine in Firefox and Safari but not Internet Explorer. Here is a basic code example. Working version http://saawcomputing.co.uk/form-test.php <form action="form-test.php" method="post"> <input type="image" src="3SM/admin/media/update1.gif" name="button" value="update" /> <input type="image" src="3SM/admin/media/delete1.gif" name="button" value="delete" /> </form> <?php if (isset($_POST['button'])) { if ($_POST['button'] == "update") { echo "Will update"; } else { echo "Will delete"; } } ?> |
|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
stuart1231 wrote:
> <form action="form-test.php" method="post"> > <input type="image" src="3SM/admin/media/update1.gif" name="button" > value="update" /> > <input type="image" src="3SM/admin/media/delete1.gif" name="button" > value="delete" /> Internet Explorer handles button images differently from ordinary buttons. Instead of passing the value, it passes the x and y positions of the mouse click. Use the following code to examine the data that's actually being sent when the form is submitted: if ($_POST) { print_r($_POST); } I can't remember the exact details of what IE sends, but you will need to add extra checks to your conditional statement to detect which button is being clicked - by value in most browsers, but by x or y position in Internet Explorer. -- David Powers, Adobe Community Expert Author, "The Essential Guide to Dreamweaver CS3" (friends of ED) Author, "PHP Solutions" (friends of ED) http://foundationphp.com/ |
|
![]() |
| Outils de la discussion | |
|
|