HannahI 0 Report post Posted November 4, 2009 Hello,I have a PHP script for a login.It is a standard script I've written.My problem is that I can't get the redirect variable into the echo statment.This doesn't work: <?php$redirctURL = "http://google.com";echo '<form action=" ' . $redirctURL . ' " method="post">Username:<input type="text" name="username"> <br />Password:<input type="password" name="password"> <br /></form>';?> Share this post Link to post Share on other sites
iGuest 3 Report post Posted November 5, 2009 Hi HannahI, <?phperror_reporting(E_ALL | E_STRICT);ob_start();$redirectURL = 'https://www.google.com/&%2339 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><?phpif(!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 Share this post Link to post Share on other sites
HannahI 0 Report post Posted November 5, 2009 Thanks, mastercomputers.The main reason that I needed it is so I could pass on a variable to the program for a login and if it doesn't I would get I would get a standard login page. Share this post Link to post Share on other sites