Jump to content

confitm befor submission of a link


Recommended Posts

Dear friends,

 

I want to know how to ask user if they really want to do a simple task like deleting a member from database.

 

I made a link like "manage.php?action=delete?id=2", ofcourse by clicking on this link user with id=2 will be deleted from the database. but how to ask from user if they really want to delete or not? I know there is a method to confrim FORM submission, but I dont want to convert every link like that to a form.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/160762-confitm-befor-submission-of-a-link/
Share on other sites

You could so something like this:

 

if(!isset($_GET['confirmed']))
{
echo 'Do you really want to delete this?<br /><a href="'.$_SERVER['REQUEST_URI'].'&confirmed=true">yes</a>';
}
else
{
//delete....
}

 

This is just an example - it'd be more secure to do with the POST method and a form, but you get the idea...

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.