导读:今天编程笔记来给各位分享关于怎么用php制作注册程序的相关内容,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览:1、易语言+PHP+数据库做注册登录程序 怎么做,最好
导读:今天编程笔记来给各位分享关于怎么用php制作注册程序的相关内容,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
1、易语言+PHP+数据库做注册登录程序 怎么做,最好是有教程跟源码!
2、使用php实现用户注册和登录功能制作 !急求大神帮助!
3、用PHP做登陆注册页面
4、php简单网站的登录和注册怎么写
5、用PHP制作一个简易的用户注册程序
易语言+PHP+数据库做注册登录程序 怎么做,最好是有教程跟源码!
要是说教程,没有哪个教程是指定讲哪个问题的,这里面涉及的知识,易语言操作mysql或post或网页填表。教程都很好找。为什么说或,因为常用大概就这三种方法。
直接操作数据库,易语言直接链接网站的数据库,可以不通过php来操作,直接把要注册的帐号写进数据库,这是最直接的方法。
post,首先用httpwatch或其他抓包工具,抓取注册时的数据包,然后用易语言(精益模块)网页_访问这个方法来进行自制数据包提交。来完成注册。
网页填表,属于在超文本浏览框内打开网站注册页面,然后模拟手动来填写注册信息。
建议使用的方法是post,因为直接操作数据库安全性不高,网页填表每次都要打开一次注册页面,效率不高,建议使用post方法。post视频教程可以找 之乎者也的post教程,关于post的教程有很多
使用php实现用户注册和登录功能制作 !急求大神帮助!
1、需要建立一个数据表test
id int(10) primary key not null increment
name char(4) not null
pass char(10) not null
age int(2)
city char(5)
2、html页面自己写,用表单post传参
3、.php页面,处理接收到的参数,于数据库里面的用户名和密码比对,若果正确,用Js框,输出欢迎页面,如果不多返回到登陆页面
这里告诉你一个小技巧,很多时候我们都是拿用户名和密码一起比对,如果都正确则跳转。这个地方其实我们需要防止sql注入攻击,我们可以写两条语句,当用户名正确,我们才执行下一条密码比对语句,这样可以有效防止sql的注入攻击。
用PHP做登陆注册页面
登录页:login.php
?php
include("conn.php");
$username=$_POST['name'];
$password=$_POST['password'];
$yanzheng=$_POST['yanzheng'];
if(isset($_POST['submit']))
{
$sql=("select username,password from member where username='$username' and password='$password'") or die("sql语句执行失败");
//print_r($sql);
$ar=mysql_query($sql);
if($ar)
{
if($row=mysql_fetch_array($ar))
{
session_start();
if($_POST["yanzheng"])
{
if($yanzheng!=$_session[pic]||$yanzheng=="")
{
echo "验证码输入有误";
exit;
}
if($yanzheng==$_session[pic])
{
header("location:index.php");
}
}
}
else
{
echo "用户名或密码错误";
}
}
}
?
form action="login.php" method="post"
table border=1 align=center text" name="name" id="name"//td
/tr
tr
td用户密码:/td
tdinput type="password" name="password" id="password"//td
/tr
tr
td验证码:/td
tdinput type="text" name="yanzheng" id="yanzheng"/
img src="yanzheng1.php" /img
/td
/tr
tr
td colspan=3 align=center
input type="submit" name="submit" value="登录"/
input type="reset" name="reset" value="重置"/
a href="register.php"注册/a
/td
/tr
/table
/form
注册页:register.php
?php
include("conn.php");
if(isset($_POST['submit'])$_POST['submit']) {
if($_POST['username']=='')
{
echo "用户名不能为空";
exit();
}
if($_POST['password']=='')
{
echo "密码不能为空";
exit();
}
if($_POST['realpass']!=$_POST['password'])
{
echo "两次密码输入不一致";
exit();
}
$sql="insert into member(username,real_name,password,email,headimg) values('$_POST[username]','$_POST[username]','$_POST[password]','$_POST[email]','')";
$ar=mysql_query($sql);
if($ar)
{
header("location:index.php");
}
else
{
echo mysql_error();
}
}
?
body
form action="register.php" method="post"
table border=1 align=center login.php"返回登录页/a]/td
/tr
tr
td text" name="username" id="username"//td
/tr
tr
td password" name="password" id="password"//td
/tr
tr
td password" name="realpass" id="realpass"/
/td
/tr
tr
td text" name="email" id="email"/
/tr
tr
td submit" name="submit" value="注册"/input type="reset" value="重置"/td
/tr
/table
/form
/body
主页显示:index.php
?php
include("conn.php");
function cutstr($str,$cutleng)
{
$str = $str; //要截取的字符串
$cutleng = $cutleng; //要截取的长度
$strleng = strlen($str); //字符串长度
if($cutleng$strleng)return $str;//字符串长度小于规定字数时,返回字符串本身
$notchinanum = 0; //初始不是汉字的字符数
for($i=0;$i$cutleng;$i++)
{
if(ord(substr($str,$i,1))=128)
{
$notchinanum++;
}
}
if(($cutleng%2==1)($notchinanum%2==0)) //如果要截取奇数个字符,所要截取长度范围内的字符必须含奇数个非汉字,否则截取的长度加一
{
$cutleng++;
}
if(($cutleng%2==0)($notchinanum%2==1)) //如果要截取偶数个字符,所要截取长度范围内的字符必须含偶数个非汉字,否则截取的长度加一
{
$cutleng++;
}
return substr($str,0,$cutleng);
}
?
html
head
script type="text/Javascript"
function All(e, itemName)
{
var aa = document.getElementsByName(itemName);
for (var i=0; iaa.length; i++)
aa[i].checked = e.checked; //得到那个总控的复选框的选中状态
}
function Item(e, allName)
{
var all = document.getElementsByName(allName)[0];
if(!e.checked) all.checked = false;
else
{
var aa = document.getElementsByName(e.name);
for (var i=0; iaa.length; i++)
if(!aa[i].checked) return;
all.checked = true;
}
}
/script
/head
?php
include("conn.php");
if(isset($_POST['del']))
{
$mm = $_POST["selected"];
$id =implode(",",$mm);
$sql = "delete from forums where id in(".$id.")";
//echo $sql;
$result=mysql_query($sql);
echo $result?"删除成功":"删除失败";
}
?
table cellSpacing=0 cellPadding=0 login.php" [退出系统]/aa href="add_forum.php" [添加论坛]/a/td
td/td
/tr
tr align=middle
td ;
$result=mysql_query($sql);
$num=mysql_num_rows($result);
if($num0)
{
while($row=mysql_fetch_array($result)){
?
tr align=middle
td bgColor=#fffbecinput type="checkbox" name="selected" value="1"//td
td forums.php?F=".$row['ID']."\"".$row['forum_name']."/a/div";
echo cutstr($row['forum_description'],24);//最多显示24个字节,12个字,多余部分用省略号代替
echo "……";
?
/td
td last_post_time']."by".$row['last_post_author']?/div/td
/tr
?php
}
}
else
{
echo "tr bgColor=#fffbectd colspan=3对不起,论坛尚在创建中……/td/tr";
}
?
tr
td colspan=3 input type="checkbox" name="selected" value="1" Onclick="All(this,'selected')"/全选/不全选/td
/tr
tr
tdinput type="button" name="del" id="del" value="删除选中项"/
?php
?
/td
/tr
/table
/html
数据库你就自己建,望采纳~
php简单网站的登录和注册怎么写
注册:
用户名 :手机号或者邮箱
密码:规定6-16位字符或者6-12位,不能出现_、等字符,规定只能数字和英文字符组成
验证码:随机图片
ajax提交时验证用户名是否合法(邮箱或手机号验证)。去掉首尾空白。判断数据格式(过滤html标签,防止sql注入)
判断密码格式和长度
判断验证码正确
三者都正确。提交到后台处理:
查询用户名是否存在,如果存在,不能注册,返回页面。如果不存在则将密码加密处理(md5或者哈希加密生成一段密文,然后输入密码拼接生成的密文存入数据库更保险)
插入成功成功,返回登录界面。
登录:
和注册一样判断用户名。
提交到后台
后台可以用mysql_real_escape_string()函数对用户名和密码进行转义,防止sql注入
密码同样道理加密。去数据库查询用户名和密码,返回成功,则将用户id号和用户名存入session里。跳转页面。
用PHP制作一个简易的用户注册程序
不用isset button 你点击的时候就把表单的数据传到本页了,直接进行数据获取就可以了,然后密码长度判断一下个数(html标签中有个size可以试一下)不行的话就php中判断,手机号的这个建议用正则表达式。
结语:以上就是编程笔记为大家整理的关于怎么用php制作注册程序的全部内容了,感谢您花时间阅读本站内容,希望对您有所帮助,更多关于怎么用php制作注册程序的相关内容别忘了在本站进行查找喔。