I'm trying to make the page go back when the user presses the OK button on the alert box. The alert box appears but it doesn't go back to the previous page
Would i have to use a confirm window because i don't want to provide the cancel option, i just want a window to appear so the user has to click OK and it goes back to the previous page
print '<script type="text/javascript">';
print 'alert("Invalid please try again.")';
print 'history.back();';
print '</script>';
Just to provide a little more information I'm doing this after OR
$link =mysqli_connect(*sensitive info*) OR print '<script type="text/javascript">';
print 'alert("Invalid please try again.")';
print 'history.back();';
print '</script>';
exit();