Home >Web Front-end >HTML Tutorial >Write HTML code to log in to the specified FTP_html/css_WEB-ITnose
ftp://www.abc123.cn
Account use password pass
I see a lot of them online. But it is necessary to fill in the ftp://. Now I just want to write www.abc123.com directly. I only need to write the login account and password.
I don’t know how to write it. I hope someone who knows can write it down directly for me.
Write a simple web page (index.html), the content is to enter the user name and password to log in to "FTP".
After pressing "Login", use JScript to go to the address ftp://user:pass@www.abc123.cn.
See if this works
<script> function logFtp(){ var user=document.getElementById("username").value; var pass=document.getElementById("pass").value; var ftpdomain="www.abc123.cn"; location.href="ftp://"+user+":"+pass+"@"+ftpdomain; } </script> <input type="text" id="username" name="username"/> <input type="text" id="pass" name="pass"/> <input type="button" value="登陆" onclick="logFtp();"/>