Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2004
    Posts
    55
    Thanks
    8
    Thanked 2 Times in 1 Post

    Password redirection script

    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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.

  • #3
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by _Aerospace_Eng_
    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

  • #4
    mtd
    mtd is offline
    Regular Coder
    Join Date
    Jun 2003
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb

    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):
    Code:
    <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:
    Code:
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •