John is absolutely right, but if you are wanting to keep the password from being seen in the code, try storing the password in another location - if you are using javascript, code the script in a seperate .js file and include the following code in your HTML
<script language="JavaScript" src="myscript.js"></script>
Other options you might want to explore are using a database to store username/password combinations, using NTFS protection on the file/folder you are trying to protect (if you are using NT/2000 as the server) or set up a .htaccess file (if you are using a LINUX/UNIX server).