$updateLog = LOG_HISTORY($objOld,$objNew,"Voucher",$newVoucherNo,'UPDATE','REUSE');
echo "<script> if(confirm('Voucher has already been used! Proceed reuse?')){".$updateLog.";}</script>";
I'm trying to make a confirm box using php where if user clicks ok, the data will be inserted in function LOG_HISTORY, and if the user clicks cancel nothing will happen.
The problem is when I click cancel, the data still gets inserted to the function. Please help