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; }
  }
 </script>

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
006301c1a7f4$a195ea60$0201a8c0@icarey">news:006301c1a7f4$a195ea60$0201a8c0@icarey...
Hello,
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

Thanks,
Ivan





-- 
PHP General Mailing List (http://www.php.net/)
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