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.

Recommended Answers

All 5 Replies

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.

Member Avatar for GreenDay2001

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...

see:

http://www.javascriptkit.com/howto/htaccess3.shtml

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! :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.