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:[EMAIL PROTECTED]]
Sent: Monday, January 28, 2002 3:39 PM
To: [EMAIL PROTECTED]
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" <[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]


--
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