now i am back with some other problem.
right now, what i am trying to do is that after my form has finish query and insert the data to database, it will create a popup box that will popup that they have finish registering. after that they will be redirected back to homepage.
below is my code (short version of it)
CODE
<?php
$prm =
[
':nama' => $_POST['nama'],
':ic' => $_POST['ic'],
];
$sql = "INSERT INTO exam (nama,ic) VALUES (:nama,:ic)";
$qry = $conn->prepare($sql);
$qry->execute($prm);
?>
<script type="text/javascript">
alert('Tahniah, anda sudah memohon untuk peperiksaan);
</script>
<?php
header("location:index.php");
?>
but the problem is that after it finish query (and the data has been entered to database) no pop up shows up and the page is immediately redirected to homepage. So what did i do wrong? because i look up at w3school and i believe my script to show alert is correct.
hope sifu2 can help me.. (codemaster is for me a malaysia stack overflow)
summoning @ungka @alien3d @Eulm
ps: how do we tag someone here at this forum?