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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to