Open a new link in an if statement with PHP

hyperlink, php, url

Solution

PHP won't be able to handle opening a new window for you. The most you can do is a redirection.

header('Location: http://destination.com');

Opening a new window can be done with JavaScript

window.open('http://destination.com');

Problem

I have the 'else if' statement below, and I want to open a new page in my host (main.html), if the entry password is correct. ``` <?php $var1="1"; $pass=$_POST['password']; if ($pass==$var1) { echo "ok"; //***here is your help*** } elseif ($pass=="") {echo "No Entry"; } else { echo "Wrong Password";} ?> ``` Please suggest a PHP code for opening a new window. Thanks.

Original source