php - Delete code not working with connecting button -
on page trying have delete button on update form other edit functionality, , in attempts seems delete messes this.
this link site can test: http://exhibitjewellery.com/editstocktest.php (the button under 'all pieces in series' , clicking name opens form collapsible panel)
i have used dreaweaver cs5 wizard if getting idea of how rest of code looks. can me?
<?php if (isset($_get['delete'])) { echo 'do want delete ' . $_get['delete'] . '? <a href="editstock.php?yesdelete=' . $_get['delete'] . '">yes</a> | <a href="editstock.php">no</a>'; exit(); } if (isset($_get['yesdelete'])) { $deletesql = sprintf("delete pieces id='%s' limit 1", getsqlvaluestring($_post['id'], "int")); mysql_select_db($database_connectmysql, $connectmysql); $result1 = mysql_query($deletesql, $connectmysql) or die(mysql_error()); header("location: editstock.php"); exit(); } ?>
the above code activated button:
<input name="delete" type="button" id="delete" value="delete" style="width:20%; float:right"/>
try this
<form action="" method="get"> <input name="delete" type="submit" id="delete" value="delete" style="width:20%; float:right"/> </form>
or
<input name="delete" type="button" id="delete" value="delete" style="width:20%; float:right" onclick="window.location.href = '?delete=delete'" />
Comments
Post a Comment