我有一个关于 jquery 的问题。我的代码如下所示:
<button id="callConfirm'.$row['id'].'">DEL</button>
<div id="dialog" title="Realy?">
Realy delete '.$row['marks'] .' s váhou '.$row['weight'] .' z '.$row['id'] .' ?
</div>
<script type="text/javascript">
$("#dialog").dialog({
autoOpen: false,
modal: true,
buttons : {
"Opravdu" : function() {
alert("You have confirmed!"); },
"Ne" : function() {
$(this).dialog("close");
}
}
});
$("#callConfirm'.$row['id'].'").on("click", function(e) {
e.preventDefault();
$("#dialog").dialog("open");
});
</script>'
我需要单击以使Opravdu执行如下所示的delele.php脚本:
<?php
include 'conn.php';
$back = urldecode($_GET['back']);
$id = mysql_real_escape_string($_GET['id'] * 1);
mysql_query("DELETE FROM znamky WHERE id=$id");
?>