欢迎来到天天文库
浏览记录
ID:52932197
大小:171.18 KB
页数:14页
时间:2020-04-02
《运维PHP入门(PHP登录页 WEB更新系统).pdf》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、运维PHP入门(php登录页+web更新系统)1、登录页面#catlogin.html
2、e"/>PasswordVerifycode2、验证页面验证页
3、面注意两个地方:数据库需要自己创建,并添加账号和密码信息到数据库中去;还有就是session的调用;#cathandle_login.php
4、//密码$imgcode=strtolower($_POST['imgcode']);//接受从登陆输入框提交过来的验证码并转化为小写;$myimagecode=strtolower($_SESSION['thisimagecode']);//从session中取得验证码并转化为小写;if($imgcode!=$myimagecode){echo'Pleaseenterthecorrectverificationcode.';exit;}#拿着提交过来的用户名和密码去数据库查找,看是否存在此用户名以及
5、其密码$link=mysql_connect('localhost','root','iha456');mysql_query('setnamesutf8');$re=mysql_select_db('companysystem',$link);$sql="select*fromadminwhereusername='$username'andpassword='$password'";$result=mysql_query($sql);$rows=mysql_fetch_assoc($result)
6、;if($rows){$SESSION['is_login']=$rows['username'];header("Location:update.php");exit;#echo';';}else{$is_login='';header("Location:login.html");exit;#echo';';}?>3、验证码生成页面注意一个地方,那就是指定的字体,必须在服务器本地有这个字体,而且你还有指定含有的字体的名称,要不然是不会显示验证码的。#catcode.php
8、0,30);//创建一张宽为200,高为30的画布//Createsomecolors$bg=imagecolorallocate($im,155,100,255);//给画布加上背景颜色$white=imagecolorallocate($im,255,255,255);//三原色白色//$grey=imagecolorallocate($im,128,128,128);$black=imagecolorallocate($im,0,0,0);//黑色
此文档下载收益归作者所有