Solved

Confirmation box before delete

Posted on 2011-03-15
2
466 Views
Last Modified: 2012-05-11
Hi
I have”Delete” text as a link (please see the code bellow). When you click on the Delete sends id-delnumber to delete function. I will make it that appears a message box and ask if you sure? Yes and No, before the delete-id sends to the delete function.

<?php   echo "<a href=lastnews.php?id-delnumber=".$row["id"]."> Delete </a>"; ?>
0
Comment
Question by:sam20
2 Comments
 
LVL 8

Accepted Solution

by:
Rik-Legger earned 500 total points
ID: 35138951
It is a little bit hard to read what you exactly want,
but i think you mean something like this:

<?php   
echo "<a href=lastnews.php?id-delnumber=".$row["id"]." onclick=\"if (confirm('Are you sure you want to delete?')) { return true;  }; return false;\"> Delete </a>"; 
?>

Open in new window

0
 

Author Closing Comment

by:sam20
ID: 35139123
Thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Echo vs ?><?php  html code 4 45
WordPress syntax 2 26
How to count in a table in php 22 14
PHP & MySQL - Rounding Results from a Select Query 3 9
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now