On Mon, 28 Jun 2004 00:18:48 GMT, - CT - wrote:
Is it possible to use javascript to get a list of files from the current
directory where the html page that contains the javascript is being
called?
You have to modify this to bypass the login function.
<!-- TWO STEPS TO INSTALL FTP SERVER LOGIN:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaS cript">
<!-- Original: Reinout Verkerk -->
<!-- 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.v alue;
var password = form.password.v alue;
var server = form.server.val ue;
if (username && password && server) {
var ftpsite = "ftp://" + username + ":" + password + "@" + server;
window.location = ftpsite;
}
else {
alert("Please enter your username, password, and FTP server's address.");
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form name=login>
<table width=250 border=1 cellpadding=3>
<tr>
<td colspan=2 align=center><b ><h2>Logon to FTP Server!</h2></b></td>
</tr>
<tr>
<td>Username: </td>
<td><input type=text name=username size=20></td>
</tr>
<tr>
<td>Password: </td>
<td><input type=password name=password size=20></td>
</tr>
<tr>
<td>Server:</td>
<td><tt>ftp://</tt><input type=text name=server size=14></td>
</tr>
<tr>
<td colspan=2 align=center>
<input type=button value="Login!" onClick="Login( this.form)"></td>
</tr>
</table>
</form>
</center>
<!-- Script Size: 1.53 KB -->