Page 1 of 1

question about opening a new page within an if statement

Posted: Tue Jul 07, 2009 8:59 pm
by purified
Im a newbie in html and php, and a sample code is given below

<?php
$username = $_GET['username'];
$password = $_GET['password'];
if ($username == 'admin' && $password == 'admin'){
// open a new page.
I WANT A NEW PAGE TO OPEN UP ON THE LOGIN PAGE IF THE USERNAME = admin and PASSWORD = admin ????

}

?>

thanks.

Re: question about opening a new page within an if statement

Posted: Tue Jul 07, 2009 9:29 pm
by ambivalent
header() is what you're looking for.

Re: question about opening a new page within an if statement

Posted: Wed Jul 08, 2009 3:31 pm
by purified
well i did some research and found that javascript is better for opening windows at client side//

<script language="javascript">
<!--
window.open('newpage.html', 'example', config='height=400,width=400')
-->
</script>