/    Sign up×
Community /Pin to ProfileBookmark

"So you want a Baisc PHP login page"

I’ve used the .htaccess method for setting up password protection, but I’d like to have a page where the login is build into the front page vs the “popup” done via the .htaccess method.

I’ve looked at a few PHP pages, but they all seem to be for setting up a user registration system. I just need a basic 1 or 2 user page.

Any help ?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@TecBratOct 12.2011 — You'll want to learn how to set session. (pretty easy, actually).

Set your user credentials in an array. (I'd use an associative array where the username is the key and the password is the value. Wanna get fancy? Use MD5 to hash it.)

Submit a form with username and password.

check it against the array. (If you hashed the password in your array, hash the submitted password before the test.) Set the session "Logged In" to true and you're set.

http://www.php.net/manual/en/book.session.php
Copy linkTweet thisAlerts:
@mark19283authorOct 13.2011 — Well my concern is

A) I know nothing about PHP. .htaccess is easy as it's simply adding files to directories.

? I fear I would not be aware of potential security issues and doing these PHP commands securely.
×

Success!

Help @mark19283 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 5.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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