/    Sign up×
Community /Pin to ProfileBookmark

Password protect a Page but for limited time

Hello,

I am new on this forum, just found it by google ? seem to be nice place.

I have a small issu and i was not able to find a solution for it. I would like to password protect some page of my website but i would like to put a time for password to work for exemple after 24h the password is no more valid. also an admin page where i can generate a password to send to a person i would liek to give access. Is there any easy way to do this ?

Thanks for your help

to post a comment
Full-stack Developer

5 Comments(s)

Copy linkTweet thisAlerts:
@ray326Jan 03.2007 — It isn't terribly difficult but the solution depends on the web server and the server side programming facilities available.
Copy linkTweet thisAlerts:
@netuserauthorJan 04.2007 — here are the server inforamtion (host is bluehost):

Operating system Linux

Kernel version 2.6.19-1_1.BHsmp

Apache version 1.3.37 (Unix)

PERL version 5.8.5

PHP version 4.4.4

MySQL version 4.1.21-standard-log

cPanel Build 10.9.0-RELEASE 57


Thanks for your help
Copy linkTweet thisAlerts:
@ray326Jan 04.2007 — Ok, you can use Basic Authentication to protect the URL and PHP to manipulate the password file based on user information stored in a MySQL table. I.e. you've got all the pieces to do it.
Copy linkTweet thisAlerts:
@netuserauthorJan 05.2007 — that's nice but what i want to know is how ? I can protecte access by .htaccess file but how to time limit the access with PHP or otehr method ?
Copy linkTweet thisAlerts:
@ray326Jan 05.2007 — That's what the MySQL table is for. You store the id and expiration date in a table then remove the user from the htpasswd file when his record expires.
×

Success!

Help @netuser spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...