maxat Posted July 8, 2006 Share Posted July 8, 2006 Hi, I have problem with deleting data from mysql using php my script does work with firefox but not with IE.<form action="main.php?id=user/delete" method="post"><td width="10%"><input type="image" src="../images/delete.gif" width="20" height="20" value="<?php echo ($row["id"]) ?>" name="delete" onclick="return confirm('Delete customer from the database?');"></td></form>it is part of a table, inside the table I have few image buttons such as full user info, user ordered products and delete user. For each <td> I made a form, not sure whether it is correct or not, but it does work with firefox.and delete.php<?phpif(isset($_POST['delete'])) {$query = " DELETE FROM user WHERE id = '{$_POST['delete']}' ";$result = mysql_query($query) or die(mysql_error());if(mysql_affected_rows() > 0)echo 'User deleted';}?>Can you help me to make it work with IE? Link to comment https://forums.phpfreaks.com/topic/14016-problem-with-deleting-data-from-mysql-using-php/ Share on other sites More sharing options...
shocker-z Posted July 8, 2006 Share Posted July 8, 2006 The only thing i can think of is that the action in your form is being interprited diffrently.. <form action="main.php?id=user/delete" method="post"> firefow may treat it as part of the string but IE could be treating it as a folder on the end, maby try without the slash??RegardsLiam Link to comment https://forums.phpfreaks.com/topic/14016-problem-with-deleting-data-from-mysql-using-php/#findComment-54727 Share on other sites More sharing options...
maxat Posted July 8, 2006 Author Share Posted July 8, 2006 if instead of delete.php I use another with plain text inside it displays perfectly, I think there is some problem with script but i don't know what problem Link to comment https://forums.phpfreaks.com/topic/14016-problem-with-deleting-data-from-mysql-using-php/#findComment-54729 Share on other sites More sharing options...
hackerkts Posted July 8, 2006 Share Posted July 8, 2006 Hold on, I'm a little confuse about<form action="[b]main.php?id=user/delete[/b]" method="post">Shouldn't it be delete.php ? Link to comment https://forums.phpfreaks.com/topic/14016-problem-with-deleting-data-from-mysql-using-php/#findComment-54754 Share on other sites More sharing options...
maxat Posted July 8, 2006 Author Share Posted July 8, 2006 This script calls default page to the body of main.php It is inside of main.php$id='';if(isset($_GET['id'])){$id = strip_tags($_GET['id']);}$inc = 'user/index.php';if($id != ''){$inc = ''.$id.'.php';}?>this is body part of main.php<div id="content"> <?php include($inc); ?> </div>inside user/index.php i have list of users with delete button and view info. When i select "delete" delete.php will be displayed in the body part of main.php with confirmation. To make it possible I wrote link like <form action="main.php?id=user/delete" method="post"> and it works with Firefox. Link to comment https://forums.phpfreaks.com/topic/14016-problem-with-deleting-data-from-mysql-using-php/#findComment-54757 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.