php-db | 2001011
Date: 01/14/01
- Next message: Alarion: "RE: [PHP-DB] Problem width SQL on PHP4"
- Previous message: Sebastian A. Davicco: "[PHP-DB] Problem width SQL on PHP4"
- In reply to: LosMuchachos de Devez en Cuando: "[PHP-DB] suscribe"
- Next in thread: Toby Butzon: "Re: [PHP-DB] PHP "confirm" function?"
- Reply: Toby Butzon: "Re: [PHP-DB] PHP "confirm" function?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Ok, I am trying to add a "yes"/"no" dialog for a delete operation and I was
attempting this via the javascript "confirm" function, but no matter if I
click yes or no, the php code block still executes. I tried this way:
---------------------------------------------------------
<script language="javascript">
if(!confirm("Are you sure you wish to delete this section? This will delete
all llamas in this section as well!!")) {
document.location.href="llama.php3";
} else{
<?php
$db = NewDatabase("MySQL", "fusion", "5xc7hn3", "fusion", "localhost");
$db->open();
if(!$db->execute("delete from lf_llamas where lfl_lfs_id = $id"))
die(print $db->geterror() . " while deleting from lf_llamas.");
if(!$db->execute("delete from lf_sections where lfs_id = $id")) die(print
$db->geterror() . " while deleteing from lf_sections.");
$db->close();
?>
}
document.location.href="llama.php3";
</script>
---------------------------------------------------------
thinking that the second code block would not be executed if they clicked
"no".
Does PHP have a native function for yes/no dialogs? I searched the docs and
couldn't find anything :(
Any help would be appreciated!
Sean Finkel
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Alarion: "RE: [PHP-DB] Problem width SQL on PHP4"
- Previous message: Sebastian A. Davicco: "[PHP-DB] Problem width SQL on PHP4"
- In reply to: LosMuchachos de Devez en Cuando: "[PHP-DB] suscribe"
- Next in thread: Toby Butzon: "Re: [PHP-DB] PHP "confirm" function?"
- Reply: Toby Butzon: "Re: [PHP-DB] PHP "confirm" function?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

