hello everyone,
i have this button that will delete a record, when clicked, it will display a confirm box of javascript.
here is the code for
$varconfirm ="<script>var yah = confirm (\"You are about to delete your scholarship. Continue?\"); document.write(yah);</script>";
now when i echo the value of $varconfirm, it will display either true or false, which means $varconfirm has a value.
but with the ff: code, when the user clicked cancel, still the program deletes the record.
i think i have tried many things...i dont know what else to do.
if ($varconfirm==false)
{
echo"delete canceled";
}
else if ($varconfirm==true)
{
$sqlDeleteScholar = "DELETE FROM TEMP_STUDENT_SCHOLARSHIP WHERE ((TEMP_STUDENT_SCHOLARSHIP.StudentID = '$StudentID') AND (TEMP_STUDENT_SCHOLARSHIP.Year = '$Year') AND (TEMP_STUDENT_SCHOLARSHIP.Term = '$Term'))";
$sql_resultDeleteScholar = mysql_query($sqlDeleteScholar)or die("Couldn't add record.");
if (!$sql_resultDeleteScholar) {
echo "<P>Couldn't delete list!</p>";
} else {
echo"RECORD DELETED!";
any help is very much encouraged.
thanks in advance,
alvean