Andrew Prostko wrote:
I am new to PHP and to email lists so I apologize in advance.
What I am trying to do is to take a password from user input, check
it to make sure it is == to something, say “burgers”
My problem is, I do not know how to make the Else statement...
How do I get it to open a new url?
I want it IF yes open this page, else open this page
or
If it is not correct then Say the password is incorrect or
something…
Else
Open a different webpage
My last attempt:
---------------
<BODY onLoad="top.window.focus()">
<?php
// Define your password
$password = "burgers";
if ($_POST['pw'] != $password) {
?>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR>
<TD ROWSPAN=2 WIDTH=50%>
<img src="images/charlee.gif">
</TD>
<TD WIDTH=50% ALIGN=CENTER VALIGN=MIDDLE>
<FONT FACE="ARIAL" SIZE=2><B>You'll need a password to get in here. We're
tryin' to keep out the
riff-raff.</B></FONT><BR>
</TD>
</TR>
<TR>
<TD WIDTH=50% ALIGN=CENTER VALIGN=BOTTOM>
<CENTER>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<br />
Name: <input type="text" name="Name" />
<br />
Email: <input type="text name="email" />
<br />
What is the Current Coupon Password?: <input type="text" name="pw" />
<input type="submit" value="Get Coupon!"/>
</form>
<A HREF="index.html" TARGET="_blank"><B>Return to Char-lees</B></A></FONT>
</CENTER>
</TD>
</TR>
</TABLE>
<?php
}
else{
$file = fopen("http://www.google.com/","r";
?>
<?php
} ?>
---------------
This creates a nice small form with an image to the left.
My problem is, I do not know how to make the Else statement...
How do I get it to open a new url?
I want it IF yes open this page, else open this page
Andrew Prostko
AProstko @ verizon.net
You might be in need of the header() function in php
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php