I have a page with a login form in a file form.php, when I press ok it call the file post_form.php where it checks the inserted data. If data are ok, I must automatically open the file confirm.php, how I can do this?
Asked
Active
Viewed 263 times
3 Answers
2
You can just use the header() function of PHP.
But be sure that there is NO output before the header() call or it will fail.
if(HERE YOUR CONDITION) {
header("Location: confirm.php");
}
Marcel Balzer
- 2,591
- 2
- 15
- 31
0
ob_clear(); //Make sure you've done ob_start() or not output anything to the browser
header('Location: confirm.php');
exit;
ʰᵈˑ
- 11,045
- 2
- 22
- 47