0
我有一個真正愚蠢的問題,我正在嘗試理清。我已經制作了這個腳本來顯示和刪除數據庫中的用戶。但是我的警報功能不起作用。它將執行刪除數據庫中內容的操作,而不管我在出現警報時按什麼內容。這裏是我的代碼:警報功能不起作用
<?php include_once "includes/scripts.php"; ?>
<?php include_once "includes/connect.php";?>
<?php include_once "includes/cms_page_security.php";?>
<div id="cms_container"><br>
<br>
<h1>MANAGE USERS<img src="images/three_column_grid_line.png" alt="line"></h1>
<p class="logout_btn"><a href="admin_cms.php">Back</a></p>
<?php
$tbl="users";
$sql = "SELECT * FROM users";
$result = mysql_query($sql, $connect);
while($rows = mysql_fetch_array($result)){
echo $rows['user_name'];
echo ' ';
echo $rows['user_id']
?>
<a href="includes/delete_user.php?user_id=<?php echo $rows['user_id'] ?>" onClick="alertFunction()">delete</a>
<?php
} mysql_close();
?>
<script>
function alertFunction()
{
var r=confirm("Do you want to delete this user?");
if (r==true)
{
}
else
{
return (false);
}
}
</script>
</div><!--cms_container-->
</body>
</html>
我只想提醒功能停止然後刪除內容的過程中,當我按取消。
Thanx很多這真的幫助! –