Hi HannahI,
CODE
<?php
error_reporting(E_ALL | E_STRICT);
ob_start();
$redirectURL = 'http://www.google.com/';
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" onsubmit="window.location.href=<?php echo $redirectURL; ?>;">
<fieldset>
<legend>Login Form</legend>
<ul>
<li><label for="username">Username:</label> <input id="username" name="username" type="text" /></li>
<li><label for="password">Password:</label> <input id="password" name="password" type="password" /></li>
</ul>
<input id="login" name="login" type="submit" value="Login" />
</fieldset>
</form>
<?php
if(!empty($_POST['login']) && $_POST['login'] === 'Login') {
header('Location: ' . $redirectURL);
}
ob_end_flush();
?>
Hope this is what you're looking for?
I don't understand why you would use the action as a redirect, action is suppose to point to the forms processor, not to redirect a page.
Cheers,
MC
Comment/Reply (w/o sign-up)