Results 1 to 4 of 4

Thread: Help Password

  1. #1
    Join Date
    Oct 2006
    Location
    BUXTON
    Posts
    2,191
    Tokens
    0

    Latest Awards:

    Default Help Password

    Hey.. iv got a page.. i want people to have to use a pass to get on.. i want it to be just a pass box.. no username.. how do i do this?

  2. #2
    Join Date
    May 2005
    Location
    /etc/passwd
    Posts
    19,110
    Tokens
    1,139

    Latest Awards:

    Default

    just make one username and password in the cpanel HTACCESS Pword Directory thing. Or there is a PHP code to match a code that it put into a box with a code say in a MySQL database then if its correct, forward the user to a page, if incorrect, display an error message. I suck at PHP so don't ask me ;]
    Quote Originally Posted by Chippiewill View Post
    e-rebel forum moderator
    :8

  3. #3
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    .htaccess is the easiest by far

  4. #4
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    Something like this would work:
    PHP Code:
    <?php
    $password 
    "somepassword";

    if (
    $_POST['txtPassword'] != $password) {

    ?>

    <h1>Login</h1>

    <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
          <p><label for="txtpassword">Password:</label>
        <br /><input type="password" title="Enter your password" name="txtPassword" /></p>

        <p><input type="submit" name="Submit" value="Login" /></p>

    </form>

    <?php

    }
    else {

    ?>

    page goes here.

    <?php

    }

    ?>

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


Posting Permissions

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