Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 7th, 2006, 3:24 PM   #1
Prm753
Professional Programmer
 
Prm753's Avatar
 
Join Date: Oct 2005
Location: United States
Posts: 447
Rep Power: 4 Prm753 is on a distinguished road
Send a message via AIM to Prm753 Send a message via MSN to Prm753
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
Prm753 is offline   Reply With Quote
Old Jul 7th, 2006, 3:32 PM   #2
Zap
Guest
 
Posts: n/a
This would be good. I wish I knew more about web design. Couldn't you use html forms???
  Reply With Quote
Old Jul 7th, 2006, 3:49 PM   #3
King
Professional Programmer
 
King's Avatar
 
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 380
Rep Power: 3 King is on a distinguished road
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!
King is offline   Reply With Quote
Old Jul 7th, 2006, 3:52 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,034
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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.
Sane is offline   Reply With Quote
Old Jul 7th, 2006, 3:54 PM   #5
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 908
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
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.
titaniumdecoy is offline   Reply With Quote
Old Jul 7th, 2006, 4:18 PM   #6
Prm753
Professional Programmer
 
Prm753's Avatar
 
Join Date: Oct 2005
Location: United States
Posts: 447
Rep Power: 4 Prm753 is on a distinguished road
Send a message via AIM to Prm753 Send a message via MSN to Prm753
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
Prm753 is offline   Reply With Quote
Old Jul 7th, 2006, 4:29 PM   #7
King
Professional Programmer
 
King's Avatar
 
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 380
Rep Power: 3 King is on a distinguished road
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!
King is offline   Reply With Quote
Old Jul 7th, 2006, 4:38 PM   #8
Agent 47
Hobbyist Programmer
 
Agent 47's Avatar
 
Join Date: Nov 2005
Posts: 122
Rep Power: 4 Agent 47 is on a distinguished road
Quote:
Originally Posted by King
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
I'm having a hard time believing that
__________________
"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"
Agent 47 is offline   Reply With Quote
Old Jul 7th, 2006, 4:41 PM   #9
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Jul 7th, 2006, 4:52 PM   #10
King
Professional Programmer
 
King's Avatar
 
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 380
Rep Power: 3 King is on a distinguished road
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!
King is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:48 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC