Announcement

Collapse
No announcement yet.

Logins/passwords

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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 Spe******t

    Comment


    • #3
      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?

      Comment


      • #4
        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.

        Comment

        Working...
        X