» Форма входа

»Мoy-weB ver.4.1

» Статистика

Главная » 2008 » Август » 14 » Форма для подключения по FTP.

Форма для подключения по FTP.
14.Авг.2008 | 15:38:32
Форма для подключения по FTP.

Скрипт

Code


<script type="text/javascript">
function logType(form) {
var url = ("ftp://"+form.host.value+"/")
if(form.logtype[0].checked == true) {
checkPass(form)
}
if((form.logtype[1].checked == true) && (form.verify[1].checked == true)) {
openFtp(form,url)
}
if((form.logtype[1].checked == true) && (form.verify[0].checked == true)) {
if(confirm("Now Loggin On To " + url + " anonymously")) {
openFtp(form,url)
}
}
}
function checkPass(form) {
var ip = (form.host.value)
var user = (form.user.value)
var pass = (form.pass.value)
var uspass = (user + ":" + pass)
var url = ("ftp://" +uspass+ "@" +ip)
if((form.user.value == "") && (form.pass.value == "")) {
alert('Вы должны ввести Имя пользователя и пароль \n Прежде чем вы можете продолжить!');
document.form.user.focus()
}
if((form.user.value == "") && (form.pass.value != "")) {
alert('Enter A Username!');
document.form.user.focus()
}
if((form.pass.value == "") && (form.user.value != "")) {
alert('Enter A Password!');
document.form.pass.focus()
}
if((form.pass.value != "") && (form.user.value != "") && (form.verify[0].checked == true)) {
if(confirm("Now Loggin On To ftp://" + ip + "/ Using \n Username: " + user + " \n Password: " + pass + "")) {
openFtp(form,url)
}
}
if((form.pass.value != "") && (form.user.value != "") && (form.verify[1].checked == true)) {
openFtp(form,url)
}
}
function openFtp(form,url) {
var locbar = ("no")
var butbar = ("no")
var menbar = ("no")
var statbar = ("no")
if(form.statbar[0].checked == true) {
statbar = "yes"
}
if(form.menbar[0].checked == true) {
menbar = "yes"
}
if(form.butbar[0].checked == true) {
butbar = "yes"
}
if(form.locbar[0].checked == true) {
locbar = "yes"
}
window.open(url, "", "resizable=yes,location=" + locbar + ",toolbar=" + butbar + ",scrollbars=yes,menubar=" + menbar + ",status=" + statbar + "")
}
</script>

Форма:

Code


<form name="form" action="/">
User Login:
<input type="radio" name="logtype" value="user" checked>


Anonymous Login:
<input type="radio" name="logtype" value="anon">


Username:
<input type="text" name="user" size=15 OnFocus="window.status=('Теперь введите Имя пользователя')" OnBlur="window.status=('');">


Password:
<input type="password" name="pass" size=15 OnFocus="window.status=('Теперь введите пароль')" OnBlur="window.status=('')">


Varify Input:
Yes <input type="radio" name="verify" value="yes" checked>
No <input type="radio" name="verify" value="no">


<strong>Window Options</strong>


Location:
Yes <input type="radio" name="locbar" value="yes">
No <input type="radio" name="locbar" value="no" checked>


Buttons:
Yes <input type="radio" name="butbar" value="yes" checked>
No <input type="radio" name="butbar" value="no">


Menu Bar:
Yes <input type="radio" name="menbar" value="yes" checked>
No <input type="radio" name="menbar" value="no">


Status Bar:
Yes <input type="radio" name="statbar" value="yes" checked>
No <input type="radio" name="statbar" value="no">


<input type="text" name="host" value="ftp.coool.net.ru" size=30>
<input type="button" name="scroll" value="Соединиться" OnFocus="window.status=('Нажмите, чтобы войти на мой FTP')" OnBlur="window.status=('')" onClick="logType(this.form)">
</form>

Категория: Скрипты для UCOZ | Просмотров: 765 | Добавил: CorsaR
Добавлять комментарии могут только зарегистрированные пользователи.
[ Регистрация | Вход ]