yes/no dialog

From: Date: Tue, 24 Oct 2006 22:33:20 +0000
Subject: yes/no dialog
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13527@lists.php.net to get a copy of this message
Hi, I am new to both PHP and Smarty. Also new to JavaScript, for that matter. ;) Anyhow, I am trying to create a yes/no dialog and am having a lot of trouble. Could I please get some help? My php code looks a little like this: if($variable != NULL) { //do a sql insert statement here } else {
  //ask user if they really want to 'overwrite'    <-- yes/no goes here!!
   //if yes, then do sql update statement
//else, do nothing } So, I want the yes/no dialog to pop up in that else block. Using JavaScript was suggested, but I have not been able to figure out how to get the value of the yes/no (I got the pop-up by using a php print statement). In addition, I have a number of variables above the if block that are used for the sql statements. I don't want to 'lose' these variable due to POST or whatever else. I'd also like to avoid complex logic to pass them around between the template and php files. Ideas? Thanks, Michael Kolakowski HPC-1

« previous php.smarty.general (#13527) next »