Use JavaScript to achieve a fast mailbox login Method!!

Source: Internet
Author: User
Tags reset
The first step: Make a login form and send the required data to the JavaScript function.
<form name=″mailform″action=″javascript:go () ″onsubmit=″return check (this) ″method=″post″>

<p><select name=″mailselect″size=″1″>

<option selected Value=″none″> Select Mailbox </option>

<option value=″mail.sina.com.cn/cgi-bin/login;u;psw″> Sina </option>

<option value=″web.163.net/cgi/login;user;pass″>163</option>

<option value=″freemail.263.net/cgi/login;user;pass″>263</option>

<option value=″freemail.990.net/prog/login;user;pass″>990</option>

</select><br>

Account: <input type=″text″name=″name″size=″12″onfocus=″this.select () ″><br>

Password: <input type=″password″name=″password″size=″12″onfocus=″this.select () ″><br>

<input Type=″submit″value=″ Login ″style=″font-size:9pt″name=″submit″>

<input Type=″reset″value=″ Reset ″name=″reset″style=″font-size:9pt″></p>

</form>

Step Two: Place the following code between
<script language=″javascript″><!--

function Makeurl () {var objform=document.mailform;

var Intindex=objform.mailselect.options.selectedindex;

var Varinfo=objform.mailselect.options[intindex].value;
var arrayinfo=varinfo.split (′;′);
var Strname=objform.name.value,varpasswd=objform.password.value;

var strprovider=arrayinfo[0],stridname=arrayinfo[1],varpassname=arrayinfo[2];

var strurl=′http://′+strprovider+′?′+stridname+′=′+strname+′&′+varpassname+′=′+varpasswd;
return strurl;

}

function Go () {

var strlocation=makeurl ();

window.open (strlocation,′′,′′);

}

function check (input) {
if (input.mailselect.options.selectedindex==0) {

Alert (″ Please select your email address!) ″);

return false;}

if (Input.name.value==″″) {

Alert (″ you forgot to fill in your account name!) ″);

Input.name.focus ();

return false;}

if (input.password.value==″″| | input.password.value.length<3) {

Alert (″ your password is less than 3 characters long?) Just fill it out again! ″);

Input.password.focus ();

return false;}

else return true;

}

--></script>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.