Use Javascript on the links.  I've done this for all delete links I've done
with database-driven sites.  Place the following code in the <head> section
of the pages:

 <script language="Javascript">
  var goTo;
  function verifyClick(goTo) {
   var choice;
   choice = confirm("Are you sure you want to delete this entry?");
   if (choice) { window.location = goTo; }

Then just have it print something like the following for the links:

<a href="javascript:verifyClick("delete.php?id=xxx")">Delete</a>

of course you'll need to set up the link however your scripts require, but
the basic idea here is that if the user clicks OK then the link passed to
the javascript function verifyClick() is executed.

Hope that helps.

Mike Frazer

"Ivan Carey" <[EMAIL PROTECTED]> wrote in message
Thankyou for your reply.

When a user clicks upon a delete link that deletes a record from a database,
I would like to be able to give them the option to OK or Cancel this action.

I have tried coding the browsers built in confirm box (I can bring up this)
but am unable to combine it with php or a combination of php and a
javascript funtion


PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to