js实现注册登录 PHP网络开发详解:注册页面的实现[1]
PHP网络开发详解:注册页面的实现[1]
——此文章摘自《完全手册PHP网络开发详解》定价 ¥ 特价 ¥ 详细>>//track linktech cn/?m_id=dangdang&a_id=A &l= &l_type = width= height= border= nosave>注册页面实际上就是对users表添加记录 需要注意的是注册页面往往需要验证用户两次输入的密码是否相同 其流程如图 所示
![js实现注册登录 PHP网络开发详解:注册页面的实现[1]](http://img.zhputi.com/uploads/90d7/90d75716066874ef783a39b489a0e30467804.jpg)
//develop csai cn/web/images/ jpg >图 用户注册流程
具体代码如下所示 <! 注册页面文件 reg php > <?php require_once( Connections/conn php ); ?> <?php //连接数据库 mysql_select_db($database_conn $conn); $query_rs_config = SELECT * FROM config templates WHERE config template_ id=templates template_id ; $rs_config = mysql_query($query_rs_config $conn) or die(mysql_error()); $row_rs_config = mysql_fetch_assoc($rs_config); $totalRows_rs_config = mysql_num_rows($rs_config); //文本字符串转换 function GetSQLValueString($theValue $theType $theDefinedValue = $theNotDefinedValue = ) { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case text : $theValue = ($theValue != ) ? $theValue : NULL ; break; } return $theValue; } //两次密码输入确认 if($_POST[ password ] != $_POST[ password_cfm ]) { echo <script>alert( 错误 两次密码输入不一致! );</script> ; }
lishixinzhi/Article/program/PHP/201311/21403