<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD><TITLE>用户登录</TITLE>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #EEF2FB;
}
.STYLE1 {color: #FF0000}
-->
</style>
<body>
<?php
include("../include/dbconnect.php");
if(isset($_POST['op'])){
//调用check_form函数进行过滤
//将当前页面form表单的input信息进行过滤
//method = post ----- $_POST[]
//input 的name属性分别是edit[name]、edit[pass]、edit[pass2];
//
//$_POST['edit'];
@$sql = "insert into qiye (id,name,pass,Email,address,wangzhi,jy,lianxif,lianxir,phone,fax,cellphone,otherway) values('','".$_POST['name']."','".$_POST['pass']."','".$_POST['mail']."','".$_POST['address']."','".$_POST['wangzhi']."','".$_POST['jy']."','".$_POST['lianxif']."','".$_POST['lianxir']."','".$_POST['phone']."','".$_POST['fax']."','".$_POST['cellphone']."','".$_POST['otherway']."')";
@mysql_query($sql);
//$row = mysql_fetch_array($res);
}
?>
<SCRIPT language="javascript">
function $ ( pElementID ) {
return document.getElementById(pElementID);
}
<!--电子邮件地址验证-->
function chemail(email){
if(email.value.indexOf('@',0)==-1){
alert("请输入正确的电子邮件地址");
email.focus();
return false;
}
else{
window.open("checkmail.html"/*tpa=http://210.31.39.188:8090/job/checkmail.html*/,"","height=100,width=300,toolbar=no, menubar=no, scrollbars=no,resizable=no")
}
}
<!--会员名验证-->
function checkuser(username){
var reg= /^[A-Za-z]+$/;
if(username.value==""){
alert("请输入会员名");
username.focus();
return false;
}
else{
window.open("checkuser.html"/*tpa=http://210.31.39.188:8090/job/checkuser.html*/,"","height=100,width=300,toolbar=no, menubar=no, scrollbars=no,resizable=no")
}
}
<!--密码验证-->
function checkpwd(pwd){
var infpwd=$("fpwd");
if(pwd.value==""){
infpwd.className="font_error" //提示信息字体样式
infpwd.innerHTML="请输入密码!"
return false;
}
if(pwd.value.length<6){
infpwd.className="font_error"
infpwd.innerHTML="请输入不少于6位的密码!"
return false;
}
infpwd.className = "font_true";
infpwd.innerHTML = "您填写的密码是合法的!";
return true;
}
function checkrpwd(pwd,rpwd){
var infrepwd=$("frepeatpwd");
if(rpwd.value==""){
infrepwd.className="font_error"
infrepwd.innerHTML="请输入确认密码!"
return false;
}
if(pwd.value!=rpwd.value){
infrepwd.className="font_error"
infrepwd.innerHTML="两次输入的密码不一致,请重新输入!"
return false;
}
infrepwd.className = "font_true";
infrepwd.innerHTML = "请牢记您输入的密码!";
return true;
}
</script>
<table border="0" bgcolor="#CCCCCC" align="center" >
<!--action=“可以为当前页面,也可以为另外一个独立的php页面”-->
<form action="partners_add.php" method="post">
<!--数据表not null的字段形成对应的input-->
<tr><td>会员名称:</td><td><input type="text" name="name" size="30" class="register-input">
<INPUT name="check2" type="button" value=" "class="register-check" onClick="checkuser(name)"> <br> 会员名须以字母开头,至少6位</td></tr>
<tr><td>口令:</td><td><input type="password" name="pass" class="register-input" onBlur="checkpwd(pass)"><DIV id="fpwd">密码设置至少6位</DIV> </td></tr>
<tr><td>确认口令:</td><td> <input type="password" name="pass2" class="register-input" onBlur="checkrpwd(pass,pass2)"><DIV id="frepeatpwd">请再次确认密码</DIV></td></tr>
<tr><td>mail:</td><td><input type="text" name="mail" >
<INPUT name="check1" type="button" value=" "class="register-check" onClick="chemail(mail)">
</td></tr>
<tr><td>公司地址:</td><td><input type="text" name="address" ></td></tr>
<tr><td>网址:</td><td><input type="text" name="wangzhi" ></td></tr>
<tr><td>经营范围:</td><td><input type="text" name="jy" ></td></tr>
<tr><td>联系方式:</td><td><input type="text" name="lianxif" ></td></tr>
<tr><td>联系人:</td><td><input type="text" name="lianxir" ></td></tr>
<tr><td>电话:</td><td><input type="text" name="phone" ></td></tr>
<tr><td>手机:</td><td><input type="text" name="cellphone" ></td></tr>
<tr><td>传真:</td><td><input type="text" name="fax" ></td></tr>
<tr><td>其他联系方式:</td><td><input type="text" name="otherway"></td></tr>
<!--提交按钮,同步交互-->
<!--javascript验证各项信息的有效性:第一种 <form ... οnsubmit="return check_form();"> 第二种 <input ... οnclick="return check_form();">-->
<tr><td>
<input type="submit" name="op" value="提交" onClick="return check_form();"/></td><td>
<input type="reset" value="重置"/></td></tr>
</form>
</table>
</BODY>
</HTML>
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD><TITLE>用户登录</TITLE>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #EEF2FB;
}
.STYLE1 {color: #FF0000}
-->
</style>
<body>
<?php
include("../include/dbconnect.php");
if(isset($_POST['op'])){
//调用check_form函数进行过滤
//将当前页面form表单的input信息进行过滤
//method = post ----- $_POST[]
//input 的name属性分别是edit[name]、edit[pass]、edit[pass2];
//
//$_POST['edit'];
@$sql = "insert into qiye (id,name,pass,Email,address,wangzhi,jy,lianxif,lianxir,phone,fax,cellphone,otherway) values('','".$_POST['name']."','".$_POST['pass']."','".$_POST['mail']."','".$_POST['address']."','".$_POST['wangzhi']."','".$_POST['jy']."','".$_POST['lianxif']."','".$_POST['lianxir']."','".$_POST['phone']."','".$_POST['fax']."','".$_POST['cellphone']."','".$_POST['otherway']."')";
@mysql_query($sql);
//$row = mysql_fetch_array($res);
}
?>
<SCRIPT language="javascript">
function $ ( pElementID ) {
return document.getElementById(pElementID);
}
<!--电子邮件地址验证-->
function chemail(email){
if(email.value.indexOf('@',0)==-1){
alert("请输入正确的电子邮件地址");
email.focus();
return false;
}
else{
window.open("checkmail.html"/*tpa=http://210.31.39.188:8090/job/checkmail.html*/,"","height=100,width=300,toolbar=no, menubar=no, scrollbars=no,resizable=no")
}
}
<!--会员名验证-->
function checkuser(username){
var reg= /^[A-Za-z]+$/;
if(username.value==""){
alert("请输入会员名");
username.focus();
return false;
}
else{
window.open("checkuser.html"/*tpa=http://210.31.39.188:8090/job/checkuser.html*/,"","height=100,width=300,toolbar=no, menubar=no, scrollbars=no,resizable=no")
}
}
<!--密码验证-->
function checkpwd(pwd){
var infpwd=$("fpwd");
if(pwd.value==""){
infpwd.className="font_error" //提示信息字体样式
infpwd.innerHTML="请输入密码!"
return false;
}
if(pwd.value.length<6){
infpwd.className="font_error"
infpwd.innerHTML="请输入不少于6位的密码!"
return false;
}
infpwd.className = "font_true";
infpwd.innerHTML = "您填写的密码是合法的!";
return true;
}
function checkrpwd(pwd,rpwd){
var infrepwd=$("frepeatpwd");
if(rpwd.value==""){
infrepwd.className="font_error"
infrepwd.innerHTML="请输入确认密码!"
return false;
}
if(pwd.value!=rpwd.value){
infrepwd.className="font_error"
infrepwd.innerHTML="两次输入的密码不一致,请重新输入!"
return false;
}
infrepwd.className = "font_true";
infrepwd.innerHTML = "请牢记您输入的密码!";
return true;
}
</script>
<table border="0" bgcolor="#CCCCCC" align="center" >
<!--action=“可以为当前页面,也可以为另外一个独立的php页面”-->
<form action="partners_add.php" method="post">
<!--数据表not null的字段形成对应的input-->
<tr><td>会员名称:</td><td><input type="text" name="name" size="30" class="register-input">
<INPUT name="check2" type="button" value=" "class="register-check" onClick="checkuser(name)"> <br> 会员名须以字母开头,至少6位</td></tr>
<tr><td>口令:</td><td><input type="password" name="pass" class="register-input" onBlur="checkpwd(pass)"><DIV id="fpwd">密码设置至少6位</DIV> </td></tr>
<tr><td>确认口令:</td><td> <input type="password" name="pass2" class="register-input" onBlur="checkrpwd(pass,pass2)"><DIV id="frepeatpwd">请再次确认密码</DIV></td></tr>
<tr><td>mail:</td><td><input type="text" name="mail" >
<INPUT name="check1" type="button" value=" "class="register-check" onClick="chemail(mail)">
</td></tr>
<tr><td>公司地址:</td><td><input type="text" name="address" ></td></tr>
<tr><td>网址:</td><td><input type="text" name="wangzhi" ></td></tr>
<tr><td>经营范围:</td><td><input type="text" name="jy" ></td></tr>
<tr><td>联系方式:</td><td><input type="text" name="lianxif" ></td></tr>
<tr><td>联系人:</td><td><input type="text" name="lianxir" ></td></tr>
<tr><td>电话:</td><td><input type="text" name="phone" ></td></tr>
<tr><td>手机:</td><td><input type="text" name="cellphone" ></td></tr>
<tr><td>传真:</td><td><input type="text" name="fax" ></td></tr>
<tr><td>其他联系方式:</td><td><input type="text" name="otherway"></td></tr>
<!--提交按钮,同步交互-->
<!--javascript验证各项信息的有效性:第一种 <form ... οnsubmit="return check_form();"> 第二种 <input ... οnclick="return check_form();">-->
<tr><td>
<input type="submit" name="op" value="提交" onClick="return check_form();"/></td><td>
<input type="reset" value="重置"/></td></tr>
</form>
</table>
</BODY>
</HTML>