0

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?

Mark
  • 141
  • 1
  • 3
  • 15

3 Answers3

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");
}
Maarkoize
  • 2,601
  • 2
  • 16
  • 34
0
ob_clear(); //Make sure you've done ob_start() or not output anything to the browser    
header('Location: confirm.php');
exit;
ʰᵈˑ
  • 11,279
  • 3
  • 26
  • 49
0

put header("Location: confirm.php"); in your if condition .

Athul Raj
  • 349
  • 3
  • 11