PHP Password Based Upon The Hour

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bunt4power@gmail.com

    PHP Password Based Upon The Hour

    I am in need of a way to password protect a directory with a generic
    password that changes with the date/time. The only problem is that I
    don't want to .htaccess or MYSQL - only PHP.

    Can anybody help me?

    Thanks-

  • Ivan Filippov

    #2
    Re: PHP Password Based Upon The Hour

    bunt4power@gmai l.com wrote:[color=blue]
    > I am in need of a way to password protect a directory with a generic
    > password that changes with the date/time. The only problem is that I
    > don't want to .htaccess or MYSQL - only PHP.
    >
    > Can anybody help me?
    >
    > Thanks-
    >[/color]
    Try something like this using sessions.

    <?php
    session_start() ;
    if($action == "login")
    {
    if($_POST['password'] == "word".date("h" );
    header("Locatio n: protected_page. php");
    }
    ?>
    <form>
    <input type="password" name="password" >
    <input type="submit" name="action" value="Login">
    </form>

    I sure hope that's right, I usually get someone else to write the HTML
    for me. :) Also I'm not sure if I'm using the right syntax for 'date()'
    so you might want to check php.net for that, no time for me to do it now.
    --
    Ivan Filippov

    Comment

    Working...