...

View Full Version : Password redirection script



dustywb
05-20-2005, 05:41 PM
:confused: not sure what language to use or how to create this, I'm needing a script that when someone logs in they are sent to another page for example:
user1 types in his password and gets sent to www.whatever.com/user1.htm
and if
user2 types in his password he gets sent to www.whatever.com/user2.htm
that make since? I'm not a very good coder starting from scratch anyways can mod stuff usually but anyways if someone knows where I can get a script like this please reply It'd be much appreciated

_Aerospace_Eng_
05-23-2005, 08:39 PM
john he was merely using the links as an example. All I have seen you do is go around criticising other people's post. I don't think its appropiate, if you can't contribute something helpful then don't post, simple as that.

JamieR
05-23-2005, 10:04 PM
john he was merely using the links as an example. All I have seen you do is go around criticising other people's post. I don't think its appropiate, if you can't contribute something helpful then don't post, simple as that.

Yeah, I agree - dustywb read the posting guidelines please.

Away from that, I think you can use PHP and MySQL for the task which you want to do :)

mtd
06-02-2005, 08:52 PM
dustywb - I'm a newcomer, but here's what I could come up with (assuming you don't have access to a database) in PHP:

1) create the login page w/ form (named, say, login_form.htm), and submit it to a php page (say, for example, index.php):
<form action="members.php" method="post">
<input type="text" name="login_name">
<input type="password" name="login_password">
<input type="hidden" name="was_submitted" value="true">
<input type="submit" value="Sign In">
</form>2) In index.php, list the following:

if ($was_submitted == "true") {
if ($login_name == "Joe" && $login_password == "mysecretphrase") {
include("page1.htm");
}
else if ($login_name == "Jan" && $login_password == "nobodyknows") {
include("page2.htm");
}
else {
echo "Invalid Username or Password. Please try again.";
}
else {
include("login_form.htm");
}3) Send your users to index.php (they never need to - and probably shouldn't - know about login_form.htm).

This is primative, at best, but should give you a basic idea. Downside is you have to enter each un/pw as an "else is", but without a database it is probably as good an option as any (as far as this newbie can see). The reason I did it like I so, with all the action taking place behind the cover of index.php is because even when a correct password is entered, the user won't be able to bookmark their page - they'll have to enter their password every visit, adding to security. This is because they will only ever see "index.php" in the address bar. I think this will work, but I haven't tested it. Let me know how it works!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum