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
https://forums.phpfreaks.com/topic/65409-solved-php-delete-confirmation-message/
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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.