Jump to content

Confirm Delete (Yes/ No)


web_master

Recommended Posts

Hi,

 

I have a form, and in a form submit for a delete picture.

 

form is like this:

 

<div><form id="UplAboutForm" action="<?php echo $_SERVER['REQUEST_URI'];?>" method="post" enctype="multipart/form-data">

<div><input name="PhotoDelete" type="submit" class="Submit" value="DELETE" /></div>

<div><input type="hidden" name="reload" value="<?php echo $Reload;?>" /></div>

<div><input type="hidden" name="aboutus_id" value="<?php echo $Request['aboutus_id'];?>" /></div>

</form></div>

 

I want One pop-up window to confirm delete with confirm text "are You..." and with two buttons YES and NO.

If they push the YES button

 

If the YES button is pushed the code is like this for deleting picture:

 

<?php 
if($_POST['PhotoDelete']) {

$photo_th = "../r_photoalbum/".$_POST['aboutus_id']."_photo_th.jpg";
$photo = "../r_photoalbum/".$_POST['aboutus_id']."_photo.jpg";
	if(is_file($photo_th)) {unlink($photo_th);}
	if(is_file($photo)) {unlink($photo);}

} // End of PhotoDelete
?>

 

So, I know that can be a javascript but I dont find anywhere the "mixed" script with javascript/php to do what I want...

 

thanx in adwanced.

Link to comment
https://forums.phpfreaks.com/topic/159392-confirm-delete-yes-no/
Share on other sites

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.