+ Reply to Thread
Results 1 to 4 of 4

Thread: Logins/passwords
      
   

  1. #1
    golfshirtsrus is offline Members
    Join Date
    May 2005
    Location
    Thailand
    Posts
    14

    Talking Logins/passwords

    It would be nice if you could supply us with a simple HTML Login/Password. A login that collects data for a customer base, and only allows entry into our site when the form is completed. Combined with an "existing customer" Password entry Box, and a "Forgotten Password" Box.

  2. #2
    Pablo is offline Moderator
    Join Date
    May 2005
    Posts
    507

    Default

    There does not exists such a thing as 'simply HTML login/password'. There always some kind of server sided script necessary to make this work and you also need a way to save your users to a database and setup email confirmation etc. It takes a 'trained' web programmer to set this all up and probably is different for every website.
    Here's something to get you started, but do not expect it to be perfect:

    1. Create a form using BlueVoda.
    2. Set these properties:
    Name: LoginForm
    Method: POST
    Action: <?php echo($HTTP_SERVER_VARS["PHP_SELF"]);?>
    Encoding type: make this field empty
    3. Add an editboxe to the form for the username:
    Name: username
    4. Add an editboxe to the form for the password:
    Name: password
    5. Add a button:
    Name: Login
    Type: submit
    6. Open Page HTML and enter this code to Start of Page:
    <?php
    session_start();
    if (!empty($HTTP_POST_VARS))
    {
    if ($HTTP_POST_VARS["password"] == "BlueVodaIsCool")
    {
    if (!isset($HTTP_SESSION_VARS["logged_in"]))
    {
    $username= $HTTP_POST_VARS["username"];
    $password = $HTTP_POST_VARS["password"];
    $logged_in = "YES";
    session_register("username");
    session_register("password");
    session_register("logged_in");
    header("Location: logged_on.html");
    }
    else
    {
    echo("<h2>Session expired!<br>Please try again later.<br></h2>");
    exit;
    }
    }
    else
    {
    echo("<h2>Invalid password!<br>You're not logged on.<br></h2>");

    }
    }
    ?>
    7. Save this page as login.bvp and make sure the publish extension is php
    8. Note that once the user has been succesfully logged on it will be redirected to logged_on.html (so make sure this page also exist)

    9. Now on every page you want to protect insert this code in the Start of Page section:
    <?php
    session_start();

    if ($HTTP_SESSION_VARS["logged_in"] != "YES")
    {
    header("Location:
    http://www.yourdomain.com/login.php");
    exit;
    }
    ?>
    Forum Moderator
    BlueVoda Specialist

  3. #3
    reichiliu is offline Corporal
    Join Date
    Sep 2005
    Posts
    11

    Default

    Thanx Pablo.

    Just one more question. I'm using the new BlueVode version and I've created a subdir which is password protected. Should I still insert your code for all of my protected pages?

  4. #4
    deepakmenghani is offline Private
    Join Date
    Oct 2005
    Posts
    1

    Default

    I am jamnadas but when I try to log in, it fails, what should I do to sign-up
    so as to be able to log-in.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49