![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
Could someone give me the basic code for password protecting a web page?
![]() |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
In HTML? Not likely. You'll need to use a server-side scripting language such as PHP to achieve a secure password protection system.
|
|
|
|
|
|
#3 |
|
Professional Programmer
|
not completely true Ooble.
look up the use of .htaccess files in google, I'll start you off with a link in order to write a complete login/logoff access system, yes, you'll need PHP, but this way you can secure directories, and i believe even certain files. -Dizz |
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Good point - forgot about those. It's still a good idea to use a server-side language, anyway.
|
|
|
|
|
|
#5 | |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
|
|
#6 |
|
Hobbyist Programmer
Join Date: Sep 2004
Posts: 207
Rep Power: 4
![]() |
You could do it with Javascript and cookies. Not the most reliable though.
Well...depending on what your definition of "complete" is.
__________________
_______________________________ BlazingWolf |
|
|
|
|
|
#7 | |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Quote:
var passw = prompt("What is the password?", "");
window.location = passw + ".htm";Break out of the "server-side-scripting == PHP" mentality ![]() |
|
|
|
|
|
|
#8 |
|
Hobbyist Programmer
Join Date: Sep 2004
Posts: 207
Rep Power: 4
![]() |
I like that mentality tho :p.
__________________
_______________________________ BlazingWolf |
|
|
|
|
|
#9 |
|
Newbie
Join Date: Jun 2005
Posts: 6
Rep Power: 0
![]() |
yeh htaccess would work. if you have access to the cpanel then you can easily restrict access to directoris with very little knowledge. if you don't have access you might want to try and ask who ever is in charge of the server.
|
|
|
|
|
|
#10 |
|
Newbie
Join Date: May 2005
Posts: 20
Rep Power: 0
![]() |
go on Dynamicdrive.com and at the site click on .htaccess password and you can make the page protected by a nice login box abit like msn login
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|