任何人都可以教我如何獲得一行數據的id然後傳遞到delete.php。我不知道如何做到這一點,即時通訊非常新的.. tnx很多。如何在alertify中得到id確認刪除
while($row = mysqli_fetch_assoc($result))
{
echo $row['id'];
echo " ";
echo $row['name'];
echo " ";
echo "<form id='form' action='delete.php'>";
echo "<input type='button' value='submit' id='btn".$row['id']."' name='but'>";
echo "<br>";
echo "
<script>
$('#btn".$row['id']."').click(function() {
alertify.confirm('Delete the selected entry?',function(e){
if(e) {
$('#form').submit();
return true;
} else {
return false;
}
});
});
</script>
";
}
首先傳播你的邏輯和html。 – mcklayin