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