php-注册页面
来源:互联网 发布:一键ghost windows密码 编辑:程序博客网 时间:2024/06/18 12:14
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="bootstrap/js/jquery.min.js" type="text/javascript"></script>
<script src="bootstrap/js/bootstrap.js" type="text/javascript"></script>
<title>用户注册</title>
</head>
<body>
<?php
/*
* Created on 2016年8月23日
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
//header('content-type:text/html;charset=utf-8');
// 包含ezSQL的核心文件
include_once "/lib/ez_sql_core.php";
// 包含ezSQL具体的数据库文件,这里以mySQL为例
include_once "/lib/ez_sql_mysql.php";
include_once "/lib/config.php";
$sUserId = $_POST["txtUserId"];
$sUserName = $_POST["txtUserName"];
$sPassword1 = $_POST["txtPassword1"];
$sPassword2 = $_POST["txtPassword2"];
$sWeiXin = $_POST["txtWeiXin"];
$sMobile = $_POST["txtMobile"];
$sParentUserId=$_POST["txtParentUserId"];
$sVerification = $_POST["txtVerification"];
if (empty ($sUserId)) {
echo "<script>alert('帐号不能为空!'); </script>";
echo "<script>window.location.href='register.php';</script>";
}
if (empty ($sUserName)) {
echo "<script>alert('昵称不能为空!'); </script>";
echo "<script>window.location.href='register.php'</script>";
}
if (empty ($sPassword1)) {
echo "<script>alert('密码不能为空!')</script>";
echo "<script>window.location.href='register.php'</script>";
}
if (empty ($sPassword2)) {
echo "<script>alert('密码不能为空!')</script>";
echo "<script>window.location.href='register.php'</script>";
}
$result=strcmp($sPassword1,$sPassword2);
if($result<>0)
{
echo "<script>alert('两次密码不相同!')</script>";
echo "<script>window.location.href='register.php'</script>";
}
if( strlen($sPassword1) <6 )
{
echo "<script>alert('密码長度不能小于6個字符')</script>";
echo "<script>window.location.href='register.php'</script>";
}
if(preg_match("/^[A-Za-z0-9]+$/",$sPassword1)){
echo "<script>alert('密码至少含有一個特殊字符!')</script>";
echo "<script>window.location.href='register.php'</script>";
}
if (empty ($sVerification)) {
echo "<script>alert('验证码不能为空!')</script>";
echo "<script>window.location.href='register.php'</script>";
}
//$SqlInsert = "insert into user_info (user_id,user_name,user_password,user_weixing,user_mobile,parent_user_id) values ('" . $sUserId . "','" . $sUserName ."''.$sPassword1."','".$sWeiXin."','".$sMobile."','".$sParentUserId."')";
$SqlInsert = "insert into user_info (user_id,user_name,user_password,user_weixin,user_mobile,parent_user_id) values('$sUserId','$sUserName','$sPassword1','$sWeiXin','$sMobile','$sParentUserId')";
echo $SqlInsert;
echo $dbconfig["DB_NAME"];
// 初始化数据库对象并建立数据库连接
$dbHelper = new ezSQL_mysql($dbconfig["DB_USER"], $dbconfig["DB_PWD"], $dbconfig["DB_NAME"], $dbconfig["DB_HOST"]);
$result=$dbHelper->query($SqlInsert);
if ($result>0 )
{
echo "<script>alert('注册成功!')</script>";
echo "<script>window.location.href='index.php'</script>";
}
else
{
echo "<script>alert('注册失败!')</script>";
echo "<script>window.location.href='index.php'</script>";
}
?>
0 0
- PHP注册页面实现
- php-注册页面
- 简单的PHP注册页面
- 用户注册页面--ajax.php.js.css
- 用php做一个注册页面
- PHP登陆注册页面的设计感悟
- 一、php简单的注册页面
- php登录注册页面(新手)
- php登录注册页面及加载
- PHP PDO+MySQL实现登录注册页面
- 注册页面
- 注册页面
- 注册页面
- 注册页面
- 注册页面
- 注册页面
- 注册页面
- 注册页面
- l6599 维修保养:如何检测氧传感器故障?
- 按钮的点动效果
- Spark技术内幕:Executor分配详解
- 【issue】让屏幕保持不暗
- 通过反射看集合泛型的本质-5
- php-注册页面
- ANDROID第一次安装打开,home键再点击启动。程序重复启动
- 安卓6.0系统权限问题android.permission.WRITE_SETTINGS
- java线程安全问题之静态变量、实例变量、局部变量
- ubuntu 安装redis
- C/C++的mem函数和strcpy函数的区别和应用
- 漫步线性代数九——求Ax=0和Ax=b
- Leetcode 10 Regular Expression Matching
- deeplearning.net 0.1 document - Logistic Regression