PHP Password Based Upon The Hour

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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?


Re: PHP Password Based Upon The Hour wrote:
Quoted text here. Click to load it
Try something like this using sessions.

if($action == "login")
    if($_POST['password'] == "word".date("h");
    header("Location: protected_page.php");
<input type="password" name="password">
<input type="submit" name="action" value="Login">

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 for that, no time for me to do it now.
Ivan Filippov

Site Timeline