On Wednesday 19 September 2007 15:50:08 Andrew Prostko wrote: > 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,
try the header() function:
<?php
if ($_POST['pw'] != $password) {
?>
...show your form...
<?php
} else {
header ("otherpage.php");
}
One problem you might be having is that the < body > tag at the very top might
be sending headers to your browser before your else statement has a chance to
kick in, generating an error which reads something like, "Headers already
sent..." Try moving it to after the conditional, like this:
<?php
if ($_POST['pw'] != $password) {
?>
< BODY onLoad="top.window.focus()" >
...rest of your form...
<?php
} else {
...and so on.
--
Richard S. Crawford
Editor-in-chief, Daikaijuzine (http://www.daikaijuzine.com)
Personal website: http://www.mossroot.com
http://www.myspace.com/underpope / underpope.livejournal.com
"We are here to help each other get through this thing, whatever it is."
(Kurt Vonnegut, 1922 - 2007)
signature.asc
Description: This is a digitally signed message part.

