Results 1 to 5 of 5

Thread: Basic password & username for my site.

  1. #1
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Basic password & username for my site.

    So i have been looking for a little script (it can be big as well) for about 2 weeks now that will let me put a username and password form in my website. Linked to some data base of some sort(can be mysql, excel...anything) Doesent have to be a data base though! can be a file being read....anythign. I can make the usernames and password myself in some file on the server(the user will not have a "register now" button). So from there when a user enters the right password corrosponding with the username, he is pushed to a folderwhich has a index file with some information like progress of work, and pictures and also a paynow button. If the password is wrong, then to some error page. The stuff in orage i can do. I can create a little program to do that however the username and stuff i cant. The form will be on every page ofthe website.

    Please help.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Take a look at the following site:

    http://www.php-mysql-tutorial.com/us...tion/index.php

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okay so i see how its done. Difficult. But i think doable. "Dhuh to me" However, where do i assign a username with a specific foldername where it can be directed to if the username and password match? I know it sounds big but for some reason i think its possible with some guidance from you. Please help.

    Thx in advance.

  4. #4
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Common some one help me out. Nothign seems to be working here!lol.

  5. #5
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    This is an older script of mine, may be of some use:

    Code:
    <?php
    if($_POST['user']) {
    if(($_POST['user'] == "Username1") && ($_POST['pass'] == "Password1")) header("Location: http://the page to go to.com");
    else if(($_POST['user'] == "User2") && ($_POST['pass'] == "Password2")) header("Location: http://the page to go to .com");
    else header("Location: error.htm");
    } else {
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <title>php log in script</title>
    </head>
    
    
    
    
    <body>
    <br><br>
    <center>
    <font size= "6">Please Log In Below</font><br><br><br>
    <form action="<?=$PHP_SELF?>" method="post">
    <p>Username: <input type="text" name="user"/>
    Password: <input type="password" name="pass"/>
    <input type= "submit" value= "Log In"/></p>
    </form>
    </center>
    </body>
    </html>
    <?php } ?>
    Changing the parts in red to match what you need, obviously.
    You can just add more of the if/else parts for each user.. or make a global page and call that with post/get etc... Shouldn't be that hard to manipulate.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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