![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
|
Private directory
Is it possible to code a login system in HTML for a private directory? If so, could you be so kind as to give me some tips to get started? I have a free server and there is no PHP support, so I cannot do it in PHP. (That, and I don't know PHP :p ) I read about how you could configure a private directory if the server was running Apache, but I'm not sure if the free server runs it or not. I just want to have a little box pop up that requires a username and password, so that I can show personal stuff to the people I want and not the strangers that visit my site on a regular basis.
Thank you. ![]()
__________________
The world's first athletic computer geek! The home of PrProgramsStudios How not to post a question: <-- Please don't reply |
|
|
|
|
|
#2 |
|
Guest
Posts: n/a
|
This would be good. I wish I knew more about web design. Couldn't you use html forms???
|
|
|
|
#3 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 380
Rep Power: 3
![]() |
You can use HTML forms and JavaScript. Do a quick google search, it's pretty easy. It's not the most secure way to do it, but with no PHP, and for your purpose it should do just fine.
__________________
I am Addicted to Linux! |
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() |
HTML is just a means to an end. Applying any restrictions to access of files would involve configuring an .htaccess / .htpasswd file in Apache, or generating the page with a server-side language. Of course you could make the login system in HTML, but you'd still need a server-side language to handle the authentication and return the private folder/files.
If your server doesn't allow PHP, then I don't think you could do it. Unless it's apache, some other popular webserver, or you have access to some other server-side language. The best thing to do would be to check the FAQ for your hosting provider. Chances are they have the functionality to set three digit restriction codes on files/folders somewhere. |
|
|
|
|
|
#5 |
|
Expert Programmer
|
If your server is running Apache, you can use a .htaccess file to password protect a directory. However, it is highly likely that your host has disabled .htaccess files for the same reason their server does not run PHP (Either for security reasons or because they want you to upgrade to a paid plan with access to such features.) A google query similar to password protect directory apache .htaccess should be sufficient.
@King: JavaScript should never be used for security. You can easily bypass it 99% of the time by looking at the page's source or disabling JavaScript in your browser, and the rest of the time it just takes a little more work. |
|
|
|
|
|
#6 |
|
Professional Programmer
|
Thanks all for the input. Sane, I checked the FAQ (it's Bellsouth who is the host, btw), and they say nothing about restricting access to a directory in their free web hosting. Of course, if you upgraded to their $29.99 a month hosting plan, you'd get all that and a bag of chips. Sadly, I DON'T have $29.99 a month, therefore, I can't afford it. But that's off topic. One day I will get a cheap hosting plan from 1&1 or somewheres like that.
I'll see if I can figure out what type of server Bellsouth is running the free web pages on. King, your way sounds the easiest to implement, but as titaniumdecoy said, it could be easily bypassed. Too bad. :p
__________________
The world's first athletic computer geek! The home of PrProgramsStudios How not to post a question: <-- Please don't reply |
|
|
|
|
|
#7 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 380
Rep Power: 3
![]() |
I forget how I did it, but I had it setup where there wasn't a way to view the source, and if you disabled JavaScript it still wouldn't allow you to view the restricted page. There would still be ways around it, but for your purpose it might work alright. I think I still have the script; I'll take a closer look at it tonight.
__________________
I am Addicted to Linux! |
|
|
|
|
|
#8 | |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 122
Rep Power: 4
![]() |
Quote:
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet" |
|
|
|
|
|
|
#9 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You cannot prevent anyone from grabbing your page other than to prevent the server from responding. This somehow seems to be a mystery to people, but any code can perform the acts performed by a browser. The browser has to grab the info before it can render. If a browser can, I can. You may resort to encryption, but if any ol' client can negotiate that, there you have it.
There is another thread here about the same claims. The OP put up a link he 'couldn't crack' because of script and disabling of the right mouse button. I responded by posting the info from the page. A cursory study of http and the client/server paradigm would go a long way towards dispelling these myths.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#10 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 380
Rep Power: 3
![]() |
Like I said above it wasn’t overly secure. I think what I did was when you click on the link to go to the restricted page, it would bring you to a page where it had a pop-up box come up for the username and password, and wouldn’t allow you to click on the actual browser window to get the source; if you entered in the right password it would flow to the restricted page, if you didn’t it would go back to the previous page. That way you can’t see the page source that does the password checking. I never actually used this because I ended up making a PHP script. Like I said there are lots of ways around it, but I did think I had it so the obvious ways of getting the page source was eliminated… but maybe not.
__________________
I am Addicted to Linux! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|