Forum Moderators: coopster
I want to make a small password protected page/area for someone to update a mysql db - kind of like a very small and simple content management system.
Would it be better to use PHP to password protect the page, or should I use htaccess?
If I use PHP is it safe to put the password in the php code of the page itself, as the user wouldn't see it like if it was javascript, or would that not be safe?
I'm not expecting anyone to hack the pages, it's a virtually unknown site (at the moment) but I would like to be safe than sorry, without going to fort-knox type lengths.
Any advice would be appreciated.
Cheers,
Helen.
[simcoweb.com...]
I want to make a small password protected page/area for someone to update a mysql db - kind of like a very small and simple content management system.
I've recently done this very same thing, using only php. The advantage doing it this way is that you can present page content before the password is required, then the password entry reloads the same page but now displaying whatever you want to display. I think this is secure enough for my needs and the password certainly isn't displayed in the page source prior to it being entered. With .htaccess, none of the page can be viewed until the password is entered.
It's also worth considering making the page in question unindexable by search engines so no-one stumbles across it who shouldn't do.