I have a customer that I am designing a website for. Part of his business is he films commercials. What he wants is to be able upload a compressed version of a customers commercial to his website for them to view. However, he doesn't want the world to be able to see it. Is there away have a web page ask for a password to allow the web page to load. If so, can you create it in java? Any help will be appreciated, or even if you could get me going in the right direction.

10 Years
Discussion Span
Last Post by josh06

How secure does it need to be?

The problem with Javascript is that the code is in the page, so it is quite easy to crack it.

You'd be better off using a server-side script (PHP, Perl, etc.). That way, the passwords are checked on the server so are harder to crack.


well, if you use JavaScript the whole code will be visible to the visitors and they would certainly crack the code....so use a server side script ASP, PHP, CGI etc...


The people that will be viewing my site more that likely not know how to do that. If someone else sees the commercial it is not that big of a deal. I guess the main reason I am wanting it is for a more professional apeal to my customers of them being able to enter a password and being able to see the commercial I created.


if you're not particularly interested in expandability/multiple users/complex permissions/etc, and your hosted on an Apache server, and you have proper access to your hosting server; you can do it without any scripting atall...



I can't say I've ever tried it; but I'll probably end up doing it in places.. If only for entertainment. :)


use javascript with asp server side ive got a book on it. Beginning Javascript by Paul Wilton. It shows you how to server side script asp and javascript and makes a login page, goto wrox.com and get the code examples, im sure its chapter 14 or 15. should help! :-)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.