How can I jump (redirect) to another page after say 6 seconds from inside PHP code. For example, I wish to say:
Code: Select all
$sql = "some code";
if(mysql_query($sql))
{ echo "Successful<br/>";
//redirect to page A after 6 seconds
}
else
{ echo "Unsuccessful";
//redirect to page B after 6 seconds
}
The only way I know how to redirect to another page after some time is using javascript.
<script type="text/javascript">
function timedMsg()
{ var t = setTimeout("location.href='file.html'",6000);
}
</script>