08-12-2004, 06:15 PM | #1 (permalink) |
Junkie
Location: San Diego
|
[html/java/php] Passwording webpages
I am making a website for my fraternity and we want to have a user/password section to protect our directory. Nothing special, just to keep random people from getting ahold of our phone numbers. The only problem is I have no clue how to program this. I am designing the site with Adobe Photoshop and making the necessary changes in Microsoft Frontpage. If anyone could help me out with a simple code or function in fp which will activate passwording that would be awesome! Thanks!
__________________
If something seems too good to be true, then it probably is.... |
08-12-2004, 06:53 PM | #2 (permalink) |
Upright
|
How is the site hosted? If it's hosted on Apache than you can start using .htaccess and .htpasswd files.
This will let you prompt for a login/password built in apache and nearly impossible to get past. Here is an example of a config for .htaccess ########## deny from all ##Allow One IP address without auth. allow from 207.144.22.22/32 AuthType Basic AuthName "Configuration System - Level 15" AuthUserFile /home/website.com/www/secured/.htpasswd require valid-user # Satisfy any will let passworded users or IP Users # Satisfy all will require you to match ip and password satisfy any # More on google! |
08-12-2004, 09:43 PM | #3 (permalink) |
Junkie
Location: San Diego
|
Thanks for the idea asdfasf1, I am looking into the server setup right now, but I won't know until late tomorrow. It doesn't have to be the most secure thing on earth I just want something to prompt a user/password for 2 webpages on the site. I need very basic, because people down the road may not know what to do. I'll keep googling but if anyone knows a simple solution let me know. Thanks!
__________________
If something seems too good to be true, then it probably is.... |
08-13-2004, 05:24 AM | #4 (permalink) |
beauty in the breakdown
Location: Chapel Hill, NC
|
There's no such thing as a decent JavaScript password utility. What you want is the Apache .htaccess that was listed above (assuming you can do that on your server). Its by far the easiest way to do that. The other way is a sessions-based php/mysql authentication scheme, but that seems to be a bit over your head
__________________
"Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws." --Plato |
08-13-2004, 11:11 AM | #5 (permalink) |
Follower of Ner'Zhul
Location: Netherlands
|
Well... if you have php and it can be as crappy as possible, why not just do:
PHP Code:
"It's quick... it's dirty... I love it" Forget who said it, but it feels like an appropriate quotation. EDIT: Okay, so I suck... I validated it and added the stylesheet some other guy made to center the damn thing. Make sure you have a recent php version for this though... my crappy 4.2.2 (Red Hat 9 ) wouldn't do the array() function, so it's kindof untested. But it should work. I do stuff like this for a living.
__________________
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. - Nathaniel Borenstein Last edited by RelaX; 08-13-2004 at 11:47 AM.. |
08-13-2004, 06:43 PM | #7 (permalink) |
Junkie
Location: San Diego
|
Thanks for your help RelaX! I played around with your code and it sorta works but it's missing something and I am still trying to figure that out. Fallon if you have something which works better, your help would be greatly appreciated! It is reasons like this which I love the TFP!
__________________
If something seems too good to be true, then it probably is.... |
08-15-2004, 06:44 PM | #8 (permalink) |
Junkie
Location: San Diego
|
Yep I'm stuck I don't know what I am doing. I have been fiddling with RelaX's code, but I am not getting it to work right. If anyone else knows what that code is missing or has a different code to use, your help would be greatly appreciated.
__________________
If something seems too good to be true, then it probably is.... |
08-16-2004, 05:01 AM | #9 (permalink) |
Junkie
Location: RI
|
Alright, this is a bit simplified and such but here goes
Hopefully you have PHP running on your server and such. PHP Code:
|
08-19-2004, 10:10 AM | #11 (permalink) |
Junkie
|
The results of PHP processing instructions don't get displayed in the browser or HTML editor if PHP didn't process the script first. Instead of using the PHP print and echo functions to send HTML to the output, you should embed processing instructions in your HTML template. That way the HTML layout gets displayed even if PHP didn't process the file first. So, instead of this:
PHP Code:
PHP Code:
|
Tags |
html or java or php, passwording, webpages |
|
|