Hi
I would like to make something i have no idea of. Since my Host has a Mysql Database and PHP installed i have to do it with PHP & SQL.
I have one PASSWORD Field - if the user enters i.e. CAR than he is redirected to http://www.mywebsite.com/car.htm and if he enters SOUND he is redirected to http://www.mywebsite.com/car_1.htm, ...
I would like to have PASSWORDs and URLs stored in mySql Database and whenever user starts the first file (ie. index.php) it should connect to the database and wait for him to type in the PASS - then it should redirect to the URL that is stored in the database and connected to the Password.
Is this possible? Any hint would be great help.
Thanks
Redirect to URL after LOGIN
Moderator: General Moderators
Yes create a form with a password field. In the form you will want something like this:
Then in the page that the form is pointing to, check if the variable is equal to any number of passwords stored in an array. The array should be set up like this:
With the level number being the number and the value being the password. Then if the user's password is equal to any of them, just use:
to send them there.
Code: Select all
<form method="post" action="checkpass.php">Code: Select all
1 => levelonepassword
2 => leveltwopassword
3 => Vncodn1dniZnhCode: Select all
header (Location: somewhere.php);