RE: [PHP] Re: How do I use a confirm box to confirm before deletion from adatabase
| From: | Boaz Yahav | Date: | Wed, 30 Jan 2002 05:10:09 +0000 |
| Subject: | RE: [PHP] Re: How do I use a confirm box to confirm before deletion from adatabase | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-82676@lists.php.net to get a copy of this message | ||
Using JavaScript to show an OK/Cancel confirmation window
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1364
Sincerely
berber
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
-----Original Message-----
From: Lerp [mailto:joe@coastaldestination.com]
Sent: Monday, January 28, 2002 3:39 PM
To: php-general@lists.php.net
Subject: [PHP] Re: How do I use a confirm box to confirm before deletion
from adatabase
Hi Ivan, I've this a number of times. What I suggest is that you have
two
forms, each with a button on the page that receives the delete request.
Both
forms post to the processing page. The first button passes a value
called
"dodelete" and the second one passes another value say, "dontdelete". On
the
processing page you determine if $dodelete is set, if it is then do your
delete. If not, redirect them to another page and bypass the whole
deleteion
process. Below if the code I use on the processing page:
<?php session_start(); ?>
<?php
if (!isset($HTTP_SESSION_VARS["islogged"])){
header("Location:index.php");
}
if(isset($dodelete)){
// connect to db
$connectionToDB = odbc_connect("4gdols4f", "jolf", "rty");
$sqldel = "DELETE FROM RECOMMENDATION WHERE recid ='$recid'";
odbc_do($connectionToDB, $sqldel);
}
else
{
header("Location:login.php");
}
?>
"Ivan Carey" <icarey@iname.com> wrote in message
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: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net