Re: Redirect

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: Redirect
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-15355@lists.php.net to get a copy of this message
If you don't want to include all of your code on one page (which is what I would suggest that way they can not bookmark the start page and bypass your password check), then you could create a Javascript on the page and use it to redirect the browser. Here is a quick example: if ($password=='correctPassword') { echo '<script> document.location.href="newPage.php";</script>'; } But I would suggest including the Start page info on the same page that gathers the password. Set a Post variable and check for it's existence on the top of the form and if it exists then check to see if it is correct, if it is then show the start page. if it is not then present the password screen again. This way there is no way they can get to the start page without entering a correct password. Jim -------Original Message------- From: Rodrigo San Martin Date: Monday, August 19, 2002 13:41:41 To: php-windows@lists.php.net Subject: [PHP-WIN] Redirect Halo. I need som help with my script. I need to find a way to redirect my script to another file. I start with the login file, which is a html file, and send variables through it to a file I call do_login. This checks if username and password is correct. On the top of this file I have a if statement that checks if the user has writen on the username and password box. If not, they get sent back to the login.html by a header("location:login.html"); Now, if username and password checks out i want to sent them to the start page. The problem is the I already have sent header information and cant use Header() anymore. Can someone tell me an easy way to solve this problem Thanks... ------------------------------------------ Rodrigo San Martin Institutt for datateknologi og informatikk http://www.idi.ntnu.no/~rodrigo -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php .

« previous php.windows (#15355) next »