question about opening a new page within an if statement

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
purified
Forum Newbie
Posts: 2
Joined: Tue Jul 07, 2009 8:54 pm

question about opening a new page within an if statement

Post 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.
User avatar
ambivalent
Forum Contributor
Posts: 173
Joined: Thu Apr 14, 2005 8:58 pm
Location: Toronto, ON

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

Post by ambivalent »

header() is what you're looking for.
purified
Forum Newbie
Posts: 2
Joined: Tue Jul 07, 2009 8:54 pm

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

Post 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>
Post Reply