User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 375,171 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,151 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 2151 | Replies: 24
Reply
Join Date: Jan 2006
Location: Tennessee
Posts: 1,567
Reputation: 'Stein is on a distinguished road 
Rep Power: 6
Solved Threads: 102
Colleague
'Stein's Avatar
'Stein 'Stein is offline Offline
Lapsed Skeptic

password protecting

  #1  
Jul 19th, 2006
Heh first off, I want to thank the responders here for the help given.

Ok, now for the prob.

I just wrote my first ever HTML page (awful if ya ask me), and I'm mainly using it as a place to keep files and such. However, it's still in development.

What I'm trying to do is password protect it's directory and all the files inclosed inside it.

Some more slight background stuff.

I read over this page for some tips, and here's my sort-of response to it:

1) I don't really need something super secure. I just want protection from the basics.
2) admin privs - I have admin status inside my directory
3) I dunno which OS/webserver I'm using (see, this space was given as a sorta gift). Is there a way to check this?


Here's the current code if ya wanna see that:

[html]<html>
<head>
<title>le John</title>
<link rel=stylesheet type="text/css" href="style.css">
</head>
<FONT FACE="Tempus Sans ITC">
<body bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0" background="img/NASA2-2.gif">

<table height="123" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top">

<td><img src="img/Einstein1.JPG" width="141" height="190" border="0" alt=""></td>

<td width="100%" background="img/spacetime.jpg">&nbsp;</td>
</tr>
</table>

<table height="40" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td width="100%" background="img/spacetime.jpg">&nbsp;</td>
</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top">

<td width="201"><BR>

&nbsp;&nbsp;&raquo;&nbsp;<a href="http://stoic_sleeper.livejournal.com/"><FONT COLOR="#FF6600"><B>My Life</B></FONT></a><BR>
<img src="img/menubar.jpg" width="201" height="11" border="0" alt=""><BR>
&nbsp;&nbsp;&raquo;&nbsp;<a href="http://www.sultanofmirth.com/jhay116/pics"><FONT COLOR="#FF6600"><B>My Pics</B></FONT></a><BR>
<img src="img/menubar.jpg" width="201" height="11" border="0" alt=""><BR>
&nbsp;&nbsp;&raquo;&nbsp;<a href="http://www.webaddresshere.com"><FONT COLOR="#FF6600"><B>Me Music</B></FONT></a><BR>
<img src="img/menubar.jpg" width="201" height="11" border="0" alt=""><BR>
&nbsp;&nbsp;&raquo;&nbsp;<a href="http://www.webaddresshere.com">your link</a><BR>
<img src="img/menubar.jpg" width="201" height="11" border="0" alt=""><BR>

</td>

<td width="100%">
<table width="100%" cellpadding="10" cellspacing="0" border="0">
<tr valign="top">
<td>

<h2><CENTER><FONT FACE="Tempus Sans ITC" SIZE="+3" COLOR="#FF0000">The Life and Times of John</FONT></CENTER></h2>
<HR WIDTH="75%" COLOR="#FF0000" SIZE="4">
<p <P align="center"><FONT FACE="Tempus Sans ITC" COLOR="#FFFF00">Well, this is just for kicks...for the most part. In reality, this is here so I have a place to backup my hard drive.<BR></p>
<p </p>
<p </p>
</FONT>


<BR><BR><BR><BR><BR><BR><BR>
<BR><BR><BR><BR><BR><BR><BR>
<p align="center">
This site is &copy; Copyright John Haydek 2006-2007, All Rights Reserved<BR></p>
</td>
</tr>
</table>
</td>

</tr>
</table>

</body>
</FONT>
</html>

[/html]

By the way, if ya wanna point out any obvious problems with it, feel free to :mrgreen:

Lastly, here's the site we're lookin at:

www.sultanofmirth.com/jhay116

Thanks again.
Last edited by 'Stein : Jul 19th, 2006 at 1:20 am.
Now if ya like the help ya could always raise our reputation...
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Posts: 4,596
Reputation: iamthwee is a jewel in the rough iamthwee is a jewel in the rough iamthwee is a jewel in the rough iamthwee is a jewel in the rough 
Rep Power: 15
Solved Threads: 294
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Industrious Poster

Re: password protecting

  #2  
Jul 19th, 2006
encryption perhaps?

http://home.zonnet.nl/MAvanEverdingen/Code/

Also, I would have thought if you are using some sorta database mysql or something, it may have built in security features?
Last edited by iamthwee : Jul 19th, 2006 at 4:56 am.
Member of: F-ugly code club

Join today don't delay!
Reply With Quote  
Join Date: Jan 2006
Location: Tennessee
Posts: 1,567
Reputation: 'Stein is on a distinguished road 
Rep Power: 6
Solved Threads: 102
Colleague
'Stein's Avatar
'Stein 'Stein is offline Offline
Lapsed Skeptic

Re: password protecting

  #3  
Jul 19th, 2006
Arg, I think I'm trying to find somethin that would password protect the page.

I tried using .htaccess & .htpasswd text files, but that didn't seem to work.
Now if ya like the help ya could always raise our reputation...
Reply With Quote  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 107
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: password protecting

  #4  
Jul 19th, 2006
You could always set permissions on the dir. Also, you could find out if the server you are using allows access to Perl or PHP and cruft up a server side app to do that (I have skeletons, so it's no problem to throw one together for you if needed).
Reply With Quote  
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: password protecting

  #5  
Jul 19th, 2006
If you only need a simple (few lines) code/script to provide basic protection, I would suggest google search for javascript password gate or similar.
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: password protecting

  #6  
Jul 19th, 2006
There is no way to secure a page using JavaScript, HTML, or CSS, the topics of this forum.

You either have to do this at the server or data layers of your application (or both).
Reply With Quote  
Join Date: Jan 2006
Location: Tennessee
Posts: 1,567
Reputation: 'Stein is on a distinguished road 
Rep Power: 6
Solved Threads: 102
Colleague
'Stein's Avatar
'Stein 'Stein is offline Offline
Lapsed Skeptic

Re: password protecting

  #7  
Jul 19th, 2006
tgreer- you couldnt password protect with html, even if it didnt matter how secure it is? Truthfully, I just dont want friends purveying my site

comatose- how would ya set permissions on the directory.

Lastly, would a javascript password gate work?

Thanks guys.
Now if ya like the help ya could always raise our reputation...
Reply With Quote  
Join Date: Aug 2005
Posts: 4,596
Reputation: iamthwee is a jewel in the rough iamthwee is a jewel in the rough iamthwee is a jewel in the rough iamthwee is a jewel in the rough 
Rep Power: 15
Solved Threads: 294
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Industrious Poster

Re: password protecting

  #8  
Jul 20th, 2006
Originally Posted by 'Stein

Lastly, would a javascript password gate work?

Thanks guys.

How about this:-

http://javascriptkit.com/script/cutindex6.shtml

It requires a password to open up a .html file. And there you can put all your secret documents.
Member of: F-ugly code club

Join today don't delay!
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: password protecting

  #9  
Jul 20th, 2006
Stein: no, you can't password-protect with client-side scripts or markup. Any code you wrote would have to be interpreted by the browser, which means it is sent to the browser, which means any password would be embedded in the code. It's as simple as viewing the source, then entering the password.
Reply With Quote  
Join Date: Aug 2005
Posts: 4,596
Reputation: iamthwee is a jewel in the rough iamthwee is a jewel in the rough iamthwee is a jewel in the rough iamthwee is a jewel in the rough 
Rep Power: 15
Solved Threads: 294
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Industrious Poster

Re: password protecting

  #10  
Jul 20th, 2006
Originally Posted by tgreer
Stein: no, you can't password-protect with client-side scripts or markup. Any code you wrote would have to be interpreted by the browser, which means it is sent to the browser, which means any password would be embedded in the code. It's as simple as viewing the source, then entering the password.

Not if you use encryption, which was one example given in that link I provided.

Encrypted Password Generator
Use our password generator to help password protect your web pages. Using advanced JavaScript techniques and some ciphering tricks, this program encrypts the password specified before storing it on the page, making it "unviewable" by simply looking at the page's source.
Last edited by iamthwee : Jul 20th, 2006 at 11:33 am.
Member of: F-ugly code club

Join today don't delay!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

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

 

DaniWeb HTML and CSS Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 11:56 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC