Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP server login script

Status
Not open for further replies.

thewebgeek

Technical User
Jan 8, 2001
22
0
0
US
Does anyone have a script that will prompt users for their ID and password, then submit the user Id and password in the following format:

ftp://<userid>:<password>@mywebsite.com/

I would like the password to be hidden from view in the address window of the browser as well.

Any ideas?

 
if you want them to go to that address, the only way to hide it is to open a new window without an address bar, but, this script should work to redirect them....


<form name=&quot;frm&quot;>
<input type=&quot;text&quot; name=&quot;user&quot;>
<input type=&quot;password&quot; name=&quot;pwd&quot;>
<input type=&quot;button&quot; onclick=&quot;enter()&quot;>
</form>

<script>
function enter()
{
user = document.frm.user.value;
pass = document.frm.pwd.value;
window.location = &quot;ftp://&quot;+user+&quot;:&quot;+pass+&quot;@mywebsite.com&quot;;
}


adam@aauser.com
 
Nope, not working. I think its the last line of your code. What is the function of window.location?
 
window.location returns or sets the current url of the window contents jared@aauser.com
 
try that same code, but a bit different like this, and compare.

hope this helps!

</hoolz>

<html>

<head>

<script language=&quot;Javascript&quot;>
<!--
function enter()
{
user = document.frm.user.value;
pass = document.frm.pwd.value;
window.location = &quot;ftp://&quot; + user + &quot;:&quot; + pass + &quot;@YOURDOMAIN.com&quot;;
}
//-->
</script>
</head>

<body>
<form name=&quot;frm&quot;>
<input type=&quot;text&quot; name=&quot;user&quot;>
<input type=&quot;password&quot; name=&quot;pwd&quot;>
<input type=&quot;button&quot; onclick=&quot;enter()&quot; value=&quot;enter&quot;>
</form>

</body>

</html> hurry up and wait!

aim screenname: phentalmyst

:D
 
try that same code, but a bit different like this, and compare.

hope this helps!

ps-this code does put the password in the window location...i may work on one that doesnt.

</hoolz>

<html>

<head>

<script language=&quot;Javascript&quot;>
<!--
function enter()
{
user = document.frm.user.value;
pass = document.frm.pwd.value;
window.location = &quot;ftp://&quot; + user + &quot;:&quot; + pass + &quot;@YOURDOMAIN.com&quot;;
}
//-->
</script>
</head>

<body>
<form name=&quot;frm&quot;>
<input type=&quot;text&quot; name=&quot;user&quot;>
<input type=&quot;password&quot; name=&quot;pwd&quot;>
<input type=&quot;button&quot; onclick=&quot;enter()&quot; value=&quot;enter&quot;>
</form>

</body>

</html> hurry up and wait!

aim screenname: phentalmyst

:D
 
Thanks! Let me know if/when you address the password hiding issue.

Also, the submit button is a little &quot;sticky&quot;. Meaning it appears as if the browser has frozen when it hasn't. For now I will just leave a message on the html page stating this. If you can resolve that, it would be greatly appreciated.
 
Well, I have a new twist. I want to process anonymous logins as well as non-anonymous. The policy is for anonymous logins to use their email addresses as the password. This works fine in Netscape, But in IE, it appears the extra &quot;@&quot; symbol gives it a hissy fit. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top