Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 28-07-2009
Member
 
Join Date: Jul 2009
Posts: 56
How can i password protect my website

Thank you very much for replying my previous question and now i am here with one more. I am sorry if this query exists, but i wanted to keep only the users i want on my page. For that i need to protect my website with a password. I really don't know how to do that. Could you guys please make me know how can i password protect my website ?
Reply With Quote
  #2  
Old 28-07-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: How can i password protect my website

Thats true that you need to make your websites password protected keep only the users you want on your page or you may have some parts of your web site may be private. You may do this in two ways, that are,, Using Server based password protection or by scripting. Follow this:-

If you want to do this by Server based than the requirement is that your host supports it.E-mail your web host and ask them what they recommend. Many web hosts are run by experienced webmasters and will be more than willing to help. They will also know details about your hosting setup.Your Hosting provider will provide control through a control panel where you can configure the protected directories and username/passwords.

Look into using server side tools, like .htaccess and .htpasswd files, php pages, or perl scripts.For a more complex membership type system, were the visitor can create and edit his own username and password, you need a fully fledged membership site system. These are normally written in php, perl or asp and usually require database (MYSQL, SQL or access) support.

Never trust anything that is supposed to password protect a page that runs on the client side, as these are the easiest to bypass, and usually only restrict users from viewing the secure page by not giving them a link straight to it. You should ensure that your host supports the necessary components before you purchase a membership system.
Reply With Quote
  #3  
Old 28-07-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: How can i password protect my website

You can also protect your website with a password using Script. The javascript displays a form to enter the Username and Password. If either is wrong, it will display and alert screen like ?Wrong Username? or ?Wrong Password?. Script will present user with password entry form, and will not let visitor see your private content without providing a password.To do so , use this script:-

Quote:
<SCRIPT>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == "letmein") {
alert('You Got it Right!');
window.open('protectpage.html');
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1.toLowerCase()!="password" & testV ==3)
history.go(-1);
return " ";
}
</SCRIPT>
<CENTER>
<FORM>
<input type="button" value="Enter Protected Area" onClick="passWord()">
</FORM>
</CENTER>
Reply With Quote
  #4  
Old 28-07-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: How can i password protect my website

The scripts can be very simple with the username and password embedded in the page but only viewable in source mode to more complex ones where the password/username is encrypted and hence more secure.

Quote:
<script language="javascript">
<!--// function pasuser(form) { if (form.id.value=="secretname") { if (form.pass.value=="secretpassword") { location="http://quickonlinetips.com/" } else { alert("Wrong Password") } } else { alert("Wrong Username") } } //-->
</script>
<form name="login">
Username: < input name="id" size="6" type="text">Password: < input name="pass" size="6" type="password">< input value="Login" onclick="pasuser(this.form)" type="button">
</form>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How can i password protect my website"
Thread Thread Starter Forum Replies Last Post
Protect game by password FRITZ31 Video Games 5 31-12-2009 01:29 AM
How to protect password? Otilio Windows Software 3 21-11-2009 05:12 PM
Protect files from download from website Quattro Software Development 3 06-11-2009 10:41 AM
How to Password protect your Computer DwinHell Windows Software 3 07-08-2009 01:07 PM
Javascript password to protect website vishodhan Software Development 2 03-03-2009 03:26 PM


All times are GMT +5.5. The time now is 03:18 PM.