没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Smarty 模版下的用户注册和登录系统
把 Smarty 模 版 加 到 工 程 中 , 在
templates 中建立的文件为样式
Smarty 配置文件
<smarty_con.php>
<?php
include_once("Smarty/Smar
ty.class.php"); // 包 含
smarty类文件
$smarty = new
Smarty(); //建立smarty实例
对象$smarty
$smarty-
>config_dir="Smarty/Confi
g_File.class.php"; // 目
录变量
$smarty-
>caching=false; //是否使用
缓存,项目在调试期间,不建议启
用缓存
$smarty->template_dir = "./templates"; //设置模板目录
$smarty->compile_dir = "./templates_c"; //设置编译目录
$smarty->cache_dir = "./smarty_cache"; //缓存文件夹
//----------------------------------------------------
//左右边界符,默认为{},但实际应用当中容易与JavaScript相冲突
//----------------------------------------------------
$smarty->left_delimiter = "{";
$smarty->right_delimiter = "}";
?>
建立用户信息数据库
数据库初始化
<config.php>
<?php
session_start();
$conn=@mysql_connect("localhost","root","") or die ("数据库链接错误");
mysql_select_db("meal",$conn);
mysql_query("set names 'GBK'");
?>
用户注册页面
<register.html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>{$title}</title>
<script language="javascript" type="text/javascript" src="../jquery/jquery-
1.8.2.js"></script>
<script language="javascript" type="text/javascript"
src="../jquery/registercheck.js"></script>
</head>
<body> <!-- 不同的表单中的input按钮的id和name 名称不能一样 -->
<form action="" method="post">
<table width="500px" bgcolor="#FFFF00" cellpadding="1"
summary="register-table">
<tr><th align="center">用户注册</th></tr>
<tr>
<td style="padding-left:50px">
<br>
用 户 名 : <input type="text" id="reguser"
name="reguser" style="width:160px; height:24px;" /> <span
style="color:#800000">*</span>
<span style="color:#800000"
id="regusertext"></span><br>
<br>
注 册 密 码 : <input type="password" id="regpassword"
name="regpassword" style="width:160px; height:24px;" /> <span
style="color:#800000">*</span>
<span style="color:#800000"
id="regpwtext"></span><br>
<br>
确 认 密 码 : <input type="password" id="regpassword1"
name="regpassword" style="width:160px; height:24px;" /> <span
style="color:#800000">*</span>
<span style="color:#800000"
id="regpw1text"></span><br>
<br>
联 系 电 话 : <input type="text" id="regtel" name="regtel"
style="width:160px; height:24px;" /> <span style="color:#800000">*</span>
<span style="color:#800000"
id="regteltext"></span><br>
<br>
QQ :
<input type="text" id="regqq" name="regqq"
style="width:160px; height:24px;" /> <span style="color:#800000">*</span>
<span style="color:#800000"
id="regqqtext"></span><br>
<br>
E-mail : <input type="text" id="regemail"
name="regemail" style="width:160px; height:24px;" /> <span
style="color:#800000">*</span>
<span style="color:#800000"
id="regemailtext"></span><br>
<br>
</td>
</tr>
<tr>
剩余14页未读,继续阅读
资源评论
- tyj1991110356302014-05-20例子不错,可以分享
Jasper杰
- 粉丝: 3
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功