全球主机交流论坛
标题:
求一个简易的源码
[打印本页]
作者:
formroot
时间:
2016-10-7 01:40
标题:
求一个简易的源码
想求一个简易的PHP源码,只要注册、登陆、和后台管理删减。不要框架的,不知道大家有没有?有的话能不能分享一下,谢谢了。
作者:
roppl
时间:
2016-10-7 01:47
那不是写一个就可以了
作者:
formroot
时间:
2016-10-7 01:49
roppl 发表于 2016-10-7 01:47
那不是写一个就可以了
看起来好像是照着PHP教程写一个就行哦。。。
作者:
roppl
时间:
2016-10-7 01:50
formroot 发表于 2016-10-7 01:49
看起来好像是照着PHP教程写一个就行哦。。。
不然你用WP博客不也可以吗。。把首页的模块删光
作者:
左手写爱
时间:
2016-10-9 14:51
前一段刚看见个,忘了名字了
你搜下,好像叫什么轻量级后台
作者:
叫妇
时间:
2016-10-9 15:11
<?php
header('Content-Type:text/html;charset=utf-8');
//1.链接数据库
mysql_connect("localhost","root","root");
//2.选择默认数据库
mysql_select_db("cms");
//用户登录页面
//判断用户是否提交了登录信息
if($_POST){
$username=$_POST['username'];
if($username==""){
echo "用户名不能为空";
exit;
}
$password=$_POST['pwd'];
if($password==""){
echo "用户名不能为空";
exit;
}
//比对数据库
// 操作数据库
$query="select id from cms_admin where aname='".$username."'and pwd='".$password."'";
$result=mysql_query($query);
if($row=mysql_fetch_assoc($result)){
//登录成功,将用户信息保存到cookie中
setcookie("username",$username,time()+24*3600);
setcookie("id",$row['id'],time()+24*3600);
echo "登录成功";
}else{
//登录失败
echo "登录失败";
}
}
?>
<!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 http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>登录系统</title>
</head>
<body>
<body>
<center><h1>用户登录</h1>
<form action="" method="post">
用户名<input type="text" name="username"/>
<br/>
<br/>
密 码<input type="password" name="pwd"/>
<br/>
<br/>
<input type="submit" value="登录"/>
</center>
</form>
</body>
</html>
欢迎光临 全球主机交流论坛 (https://fd.vvwvv.eu.org/)
Powered by Discuz! X3.4