troubleshooting Question

confirm delete code in php

Avatar of cuttone
cuttone asked on
Web Languages and StandardsPHP
16 Comments1 Solution984 ViewsLast Modified:
Our content management page has a delte link for deleting content. Problem is it is too easy to accidently delete something.

We'd like to have a popup that asks confirm delete before the deletion is actually accomplished.

This is the code:
if ($action == "delete") {
        $sql_delete="DELETE FROM $table_articles WHERE article_id='$article_id'";
        $result = mysql_query($sql_delete);
        if ($result) { echo "Article Deletion Successful"; }
        else { echo "There was a problem with your submission<br>".(mysql_error($link)); }


AND THE CODE AT THE DELTE BUTTON
<a href="<?echo $PHP_SELF;?>?action=delete&article_id=<? echo $news['article_id']; ?>">delete</a>
ASKER CERTIFIED SOLUTION
hsq91

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros