Clave
Hola expert...aqui de nuevo,gracias por tu anterior ayuda: bueno,aqui tengo un javascrip que bajé del internet que es para poner el username y la clave y he encontrado unos códigos que no entiendo:
primero ahi te mando:
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Based on FTP log in by: Reinout Verkerk -->
<!-- Original: Gordon Hudson ([email protected]) -->
<!-- Web Site: http://www.hostroute.com/ -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && password && server) {
var htsite = "http://" + username + ":" + password + "@" + server;
window.location = htsite;
}
else {
alert("Please enter your username and password.");
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<!-- The hidden form field "server" needs to be the
address of your password protected directory. -->
<form name=login>
<input type="hidden" name="server" value="www.domain.com/secure/">
Username:
<input type=text name=username size=20>
<br><br>
Password:
<input type=password name=password size=20>
<input type=button value="Login!" onClick="Login(this.form)" name="button">
</form>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
ahi hay una variable de "server",es necesario ponerlo?....pues lo que quisiera es solamente de que me pida el username y el password,si son correctos entonces que ingrese a la página "yyy", de lo contrario que salga un mensaje "x".así de simple.
mil gracias por tus ayudas.
primero ahi te mando:
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Based on FTP log in by: Reinout Verkerk -->
<!-- Original: Gordon Hudson ([email protected]) -->
<!-- Web Site: http://www.hostroute.com/ -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && password && server) {
var htsite = "http://" + username + ":" + password + "@" + server;
window.location = htsite;
}
else {
alert("Please enter your username and password.");
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<!-- The hidden form field "server" needs to be the
address of your password protected directory. -->
<form name=login>
<input type="hidden" name="server" value="www.domain.com/secure/">
Username:
<input type=text name=username size=20>
<br><br>
Password:
<input type=password name=password size=20>
<input type=button value="Login!" onClick="Login(this.form)" name="button">
</form>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
ahi hay una variable de "server",es necesario ponerlo?....pues lo que quisiera es solamente de que me pida el username y el password,si son correctos entonces que ingrese a la página "yyy", de lo contrario que salga un mensaje "x".así de simple.
mil gracias por tus ayudas.
1 Respuesta
Respuesta de gandalf26
1