![]() |
[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!
|
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! |
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!
|
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 :)
|
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. :) |
Pfft, it's not done like that =p. I can write you a dinky and quick php script tonight. All I need to do is look at my book. =p
|
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!
|
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.
|
Alright, this is a bit simplified and such but here goes
Hopefully you have PHP running on your server and such. PHP Code:
|
Fallon, I worked with your code, but I am really confused. Nothing is displayed when I load it into frontpage. Is there something missing?
|
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:
|
I figured it all out. Thanks for your help everyone!
|
All times are GMT -8. The time now is 01:35 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project