Jump to content

[SOLVED] PHP delete confirmation message


kyleldi

Recommended Posts

Is there a way in php to create a confirmation box when a user does something like delete a row from a database? I'm trying to get away w/o using javascript to pull this off, but I don't know if it's possible.  Right now I've just got it set up to delete when the link is clicked, but I don't find that to be a safe enough practice considering how easy it would be to screw up.  Any help would be appreciated.

 

Thanks,

 

Kyle

Link to comment
Share on other sites

gerkintrigg & cmgmyr in one ;)

 

$query="SELECT * FROM table";
if(mysql_query($query){
echo '<script language="javascript">alert("notification message goes here");</script>';
}

 

 

for confirm (example i found)

<html>
<head>
<script type="text/javascript">
<!--
function confirmation() {
var answer = confirm("Leave tizag.com?")
if (answer){
	alert("Bye bye!")
	window.location = "http://www.google.com/";
}
else{
	alert("Thanks for sticking around!")
}
}
//-->
</script>
</head>
<body>
<form>
<input type="button" onclick="confirmation()" value="Leave Tizag.com">
</form>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.