|
|
|
|
![]() ![]() |
Sep 2 2005, 07:01 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 407 Joined: 13-December 04 Member No.: 2,696 |
I have just made a script that deletes a row in a mysql database using an image as a button.
However it will only work in FireFox and not in IE. Can any one see away around this and help me root out the problem. This is the script in short: PHP Code: CODE $query_products = "SELECT * FROM manufacturer ORDER BY name ASC"; include('external_files/pagination.php'); // If the form was submitted, delete the items selected from the database if(isset($_POST['delete'])){ $query = 'DELETE FROM manufacturer WHERE manufacturer_id = '.(int)$_POST['delete']; // or die() doesn't go here $result = mysql_query($query) or print mysql_error(); echo"{$row_products['manufacturer_id']}"; if ($result) { // If it ran OK. echo" <center><font color=\"#00CC00\">The manufacturer was Deleted!</font></center> "; $query_products = "SELECT * FROM manufacturer ORDER BY name ASC"; include('external_files/pagination.php'); } else { // If it did not run OK. // Send a message to the error log, if desired. echo"<div class='error'>The manufacturer could not be deleted due to a system error. We apologize for any inconvenience.</div>"; } }?> <!-- Call your variables --> and: PHP Code: CODE //.....etc etc do { ?><form action="<?php echo $PHP_SELF; ?>" method="post"><? //Open all the items echo" <div class='item'> <div class='element'>{$row_products['name']}</div> <div class='element'>00/00/00</div> <div class='elementprimtool'>";?> <input type="image" name="delete" src="images/delete.jpg" value="<?php echo $row_products['manufacturer_id'] ?>" /> <? |
|
|
|
Sep 3 2005, 07:57 AM
Post
#2
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,153 Joined: 28-May 05 From: Devon, England Member No.: 7,593 ![]() |
OK, try changing it so that it is all on one line, e.g.
CODE <input type="image" name="delete" src="images/delete.jpg" value="<?php echo $row_products['manufacturer_id'] ?>" /> You could also try changing the closing tag, so you don't have a slash. Sometimes it can cause problems. I think you also need a ; after that PHP you have in the value attribute. CODE <input type="image" name="delete" src="images/delete.jpg" value="<?php echo $row_products['manufacturer_id']; ?>"> Tell us if that helps. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 11th October 2008 - 04:30 AM |