希望大家支持点击广告!
前些日子在群里头有位朋友问到怎么实现在网页上的邮箱访问功能现在将从网上看到的网站载了下来,便人便已。这个是html的代码您在访问网站时是否会在有些页面上见到这种功能---您在可以访问此网站的同时,还可以查看您免费邮箱中是否有新邮件。这个功能是不是让您觉得很心动、很神秘呢?下面,我就用ASP来举个例子让您知道是如何实现这一功能的。
首先你可以去一些提供免费邮件服务的站点,申请一个账号然后登录。在打开邮箱时,请您注意地址栏中的内容。现在以371为例,你会发现其内容通常是:http://www.371.net/prog/login?user=fighter&pass=mypassword。
其中"fighter"是您的账号,"mypassword"是您的密码。这时我们可以从这里得到3个信息。第1条是我们得到了处理文件的url及文件名:"http://www.371.net/prog/login";第2条是记录您账号的变量名:user;第3条是记录您密码的变量名:pass。我们知道这些信息后,就可着手写html文件和asp文件了。
'/*Html源文件内容如下:*/
<HTML>
<HEAD>
<METANAME="GENERATOR"Content="MicrosoftVisualStudio6.0">
</HEAD>
<title>CityClub首页</title>
<styletype="text/css">
<!--
td{font-size:9pt}
body{font-size:9pt}
select{font-size:9pt}
A{text-decoration:none;color:#003366;font-size:9pt}
A:hover{text-decoration:underline;color:#FF0000;font-size:9pt}
-->
</style>
<scriptlanguage="javascript">
functioncheck(tt){
if(window.document.form1.selectmail.selectedIndex==0){
alert("请选择您的邮箱服务器!")
window.document.form1.selectmail.focus()
returnfalse
}
if(tt.account.value==""){
alert("帐号不能为空!请填写。")
tt.account.focus()
returnfalse
}
if(tt.account.value.length<3){
alert("帐号长度不能小于3位!请填写。")
tt.account.focus()
returnfalse
}
if(tt.password.value==""){
alert("密码不能为空!请填写。")
tt.password.focus()
returnfalse
}
if(tt.password.value.length<3){
alert("密码长度不能小于3位!请填写。")
tt.password.focus()
returnfalse
}
else
returntrue
}
</script>
<BODYtopmargin=12>