Web Hosting Talk







View Full Version : .htaccess Access through forms


Studio64
07-02-2002, 01:52 AM
Is there a method to log in through a .htaccess w/ a form login?..

Thats the only way I can think to phrase it... If you don't get what I'm asking tell me :D.

The Prohacker
07-02-2002, 02:00 AM
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
if (username && password ) {
var login = "http://" + username + ":" + password + "@www.your.com/place/";
window.location = login;
}
else {
alert("Please enter a Username and password.");
}
}
// End -->
</script>
</head>

<body bgcolor="#FFFFFF">
<form name=login>
<div align="center">
<table border=1 cellpadding=3>
<tr>
<td colspan=2 align=center>
<h2 align="center">Login</h2>
</td>
</tr>
<tr>
<td>Username:</td>
<td>
<input type=text name=username size=15 maxlength="26">
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type=password name=password size=15>
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type=button value="Login!" onClick="Login(this.form)" name="button">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>


Try that..

Studio64
07-02-2002, 02:02 AM
Great hack... Javascript was my first guest to try to do it...

Thanks... Earning your name.. Especially w/ your VBull hack w/ the top posters as well...