当前位置: 首页 > news >正文

抚州网站推广苹果被曝开发搜索引擎对标谷歌

抚州网站推广,苹果被曝开发搜索引擎对标谷歌,南通网站关键词推广,怎样在网站上做营业执照公示一 登录功能 1. 创建一个登录页面(login.php),包含一个表单,用户输入用户名和密码。 2. 在表单的提交事件中,使用PHP代码处理用户输入的用户名和密码。 3. 首先,连接MySQL数据库。然后&a…

一   登录功能

        1. 创建一个登录页面(login.php),包含一个表单,用户输入用户名和密码。
        2. 在表单的提交事件中,使用PHP代码处理用户输入的用户名和密码。
        3. 首先,连接MySQL数据库。然后,使用查询语句检查用户输入的用户名和密码是否匹配数据库中的记录。
        4. 如果匹配成功,将用户ID和用户名存储在会话变量中,表示用户已登录。
        5. 重定向用户到另一个页面,比如主页(home.php)。

        示例代码:

// login.php
<?php
session_start();// 处理表单提交事件
if ($_SERVER['REQUEST_METHOD'] == 'POST') {// 获取用户输入的用户名和密码$username = $_POST['username'];$password = $_POST['password'];// 连接MySQL数据库$conn = mysqli_connect('数据库主机', '用户名', '密码', '数据库名');// 查询用户名和密码是否匹配$query = "SELECT * FROM users WHERE username='$username' AND password='$password'";$result = mysqli_query($conn, $query);if (mysqli_num_rows($result) > 0) {// 匹配成功,将用户ID和用户名存储在会话变量中$row = mysqli_fetch_assoc($result);$_SESSION['user_id'] = $row['id'];$_SESSION['username'] = $row['username'];// 重定向用户到主页header('Location: home.php');exit();} else {// 匹配失败,显示错误消息echo '用户名或密码错误';}// 关闭数据库连接mysqli_close($conn);
}
?><!-- 登录页面表单 -->
<form method="POST" action=""><input type="text" name="username" placeholder="用户名" required><input type="password" name="password" placeholder="密码" required><button type="submit">登录</button>
</form>
```

二、 退出功能

        1. 创建一个退出页面(logout.php)。
        2. 在该页面的代码中,删除当前会话中的用户ID和用户名。
        3. 重定向用户到另一个页面,比如登录页面(login.php)。

        示例代码:

// logout.php
<?php
session_start();// 删除会话中的用户ID和用户名
unset($_SESSION['user_id']);
unset($_SESSION['username']);// 重定向用户到登录页面
header('Location: login.php');
exit();
?>

三   客户身份确定

这里是指一个网站或应用程序的功能,包括登录、退出等,可以通过权限控制来实现。

1. 创建一个数据库表,用于存储用户信息和权限等级。表结构如下:

CREATE TABLE users (id INT(11) AUTO_INCREMENT PRIMARY KEY,username VARCHAR(50) NOT NULL,password VARCHAR(255) NOT NULL,role ENUM('admin', 'user') NOT NULL DEFAULT 'user'
);

2. 在登录功能的代码中,查询出用户的权限等级。

示例代码:

// login.php
if (mysqli_num_rows($result) > 0) {$row = mysqli_fetch_assoc($result);$_SESSION['user_id'] = $row['id'];$_SESSION['username'] = $row['username'];// 获取用户的权限等级$role = $row['role'];// 根据用户权限等级重定向到不同的页面if ($role == 'admin') {header('Location: admin.php');exit();} else {header('Location: user.php');exit();}
}

3. 创建不同的页面(如admin.php和user.php),根据用户的权限等级来显示不同的内容或功能。

示例代码:

// admin.php
<?php
session_start();// 检查用户是否登录
if (!isset($_SESSION['user_id'])) {header('Location: login.php');exit();
}// 检查用户的权限等级
if ($_SESSION['role'] != 'admin') {header('Location: user.php');exit();
}// 显示管理员功能
echo '欢迎管理员' . $_SESSION['username'];// 其他管理员功能代码...?>// user.php<?php
session_start();// 检查用户是否登录
if (!isset($_SESSION['user_id'])) {header('Location: login.php');exit();
}// 检查用户的权限等级
if ($_SESSION['role'] != 'user') {header('Location: admin.php');exit();
}// 显示普通用户功能
echo '欢迎用户' . $_SESSION['username'];// 其他用户功能代码...?>

以上是一个简单的实现思路和示例代码,其中的数据库连接、查询和权限控制等可能还需要根据具体需求进行修改和完善。

四、 跳蚤市场登录模块 

1.  效果

效果如下所示:

2. 登录

完整代码如下:

<?php 
session_start(); //启动会话
include "conn.php"; //引入数据库文件 
//获取数据   
if(isset($_POST['nickname']) && isset($_POST['pwd'])){//客户身份确定$nickname=$_POST['nickname'];$pwd=$_POST['pwd'];$sql="select * from custom where nickname='".$nickname."'";$result=$conn->query($sql);if($result->num_rows==0){echo "<script>alert('抱歉,你还不是我们的会员!请先注册')</script>";echo "<script>location.href='register.php'</script>";} else {$row=$result->fetch_array();if($pwd==$row['password']){$_SESSION['nickname']=$row['nickname'];$_SESSION['id']=$row['custom_id'];$_SESSION['sex']=$row['sex'];echo "<script>location.href='index.php'</script>";} else {echo  "<script>alert('密码有误!');</script>";echo "<script>location.href='login.php'</script>";}}//关闭数据库连接$conn->close();
}
?>
<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>我的登录页面</title>
<script>function login(){var nickname=document.loginform.nickname.value;var pwd=document.loginform.pwd.value;if(nickname==''){alert('请输入呢称!');return false;}if(pwd==''){alert('请输入密码!');return false;}return true;}
</script>
<style>a { color:#00f;text-decoration: none;font-size:14px;}img {border-width: 0px 0px 0px 0px;}#middle {position: relative;background-color: #cccccc;}#fm {position: absolute;top:100px;left:150px;}#fm h1{color:red;}#fm p{color:blue;}#logintable {background-color: #ffffff;margin-right:40px;}#logintable h1{color:red;}.input_label{color:blue;font-size:20px;font-weight: bold;padding-left:40px;}.input{border:solid 1px blue;font-size:16px;height:30px;width:240px;}.button{background-color: blue;color:white;font-size:18px;font-weight:bold;height:30px;width:240px;border-width:0px;}
</style>
</head>
<body>
<div align="center">
<iframe src='top.html' style='border:none;width:1020px; margin-bottom:-10px;'>
</iframe>
</div><div align="center">
<!--登录表单-->
<table width='1000' height='500' id='middle'><tr><td><div id='fm'><h1>省钱、省力、省时间</h1><p>限时抢购、特惠热卖、配送上门、满百包邮</p><img src='image\login.png' width='160' height='160' ></div><table  width='430' height='360' align='right' id='logintable'><form name='loginform' action='' method='post' onsubmit="return login()"><caption><h1>跳蚤市场用户登录</h1></caption><tr height='20'><td colspan="3"></td></tr><tr><td><span class='input_label'>呢称</span></td><td colspan='2'><input type='text' name='nickname'  class='input'></td></tr><tr><td><span class='input_label'>密码</span></td><td colspan='2'><input type='password' name='pwd' class='input'></td></tr><tr><td colspan='3' align='center'><input type='submit' value='登录' class='button'></td></tr><tr align='center'><td width="20%"><a href="index.php">首页</a></td><td><a href="logout.php">退出</a></td><td><a href="register.php">注册</a></td></tr></form></table></td>	</tr>
</table>	
</div><div align="center"><iframe src='bottom.html' style='border:none;width:1020px; margin-bottom:-10px;'>
</div>
</body>
</html>

3.  头部

top.html 代码 如下所示:

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>网站头部</title>
</head>
<style>#top{position: relative;background-color:#ccc;height:100px;}#title_1{position:absolute;top:10px;left:200px;color:red;font-size:48px;}#title_2{position:absolute;top:10px;left:400px;color:red;font-size:64px;}#title_3{position:absolute;top:10px;left:600px;color:red;font-size:48px;}#title_4{position:absolute;top:10px;left:800px;color:red;font-size:64px;}#login_reg{height:100px;text-align: right;}a { font-size:16px;text-decoration:none; padding-right:20px;}</style>
<body>
<div id='top'><div id='login_reg'><a href='login.php' target='_parent'>登录</a>&nbsp;&nbsp;&nbsp;<a href='register.php' target='_parent'>注册</a></div><span id='title_1'>跳</span><span id='title_2'>蚤</span><span id='title_3'>市</span><span id='title_4'>场</span><table width='980' align='center' border='0'><tr align="center"><td><a href="index.php" target='_parent'>首页</a></td><td><a href="publish_sell.php" target='_parent'>发布出售信息</a></td><td><a href="publish_buy.php" target='_parent'>发布求购信息</a></td><td><a href="product.php" target='_parent'>商品管理</a></td><td><a href="shopping_cart.php" target='_parent'>我的购物车</a></td></tr></table>
</div>
</body>
</html>

4 .  底部

bottom.html 代码如下所:

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>网站底部</title>
<style>#bottom{background-color:#ccc;padding:20px;color:blue;font-size:16px;}.footer-a{padding-left:30px;}
</style>
</head>
<body>
<div id='bottom'><div align='center' id=''><span class='footer-a'>我要投诉</span><span class='footer-a'>|</span><span class='footer-a'>联系我们</span><span class='footer-a'>|</span><span class='footer-a'>版权所有</span></div><p align='center'>制作者:***,制作日期:2023年11月15日</p>	
</div></body>
</html>

5.  退出

logout.php 代码如下:

<?php 
session_start();
session_destroy();
echo "<script>location.href='index.php'</script>";
?>


文章转载自:
http://tyrannously.xqwq.cn
http://quodlibetz.xqwq.cn
http://trinary.xqwq.cn
http://sofa.xqwq.cn
http://trepidant.xqwq.cn
http://distress.xqwq.cn
http://insolent.xqwq.cn
http://scripter.xqwq.cn
http://klootchman.xqwq.cn
http://denuclearize.xqwq.cn
http://doofunny.xqwq.cn
http://idiomaticity.xqwq.cn
http://goutweed.xqwq.cn
http://unguinous.xqwq.cn
http://freewill.xqwq.cn
http://wollastonite.xqwq.cn
http://kiddie.xqwq.cn
http://octave.xqwq.cn
http://apostrophic.xqwq.cn
http://cryonics.xqwq.cn
http://cardhouse.xqwq.cn
http://special.xqwq.cn
http://zoologize.xqwq.cn
http://distill.xqwq.cn
http://interfile.xqwq.cn
http://undoing.xqwq.cn
http://incorrigible.xqwq.cn
http://elves.xqwq.cn
http://komondor.xqwq.cn
http://retrojection.xqwq.cn
http://lekker.xqwq.cn
http://daintily.xqwq.cn
http://contrate.xqwq.cn
http://listeriosis.xqwq.cn
http://hypogamy.xqwq.cn
http://audibility.xqwq.cn
http://logy.xqwq.cn
http://shunless.xqwq.cn
http://decussate.xqwq.cn
http://chlorophenol.xqwq.cn
http://analogic.xqwq.cn
http://superloo.xqwq.cn
http://outscriber.xqwq.cn
http://shakeress.xqwq.cn
http://chapelmaster.xqwq.cn
http://chlorination.xqwq.cn
http://beverly.xqwq.cn
http://circlet.xqwq.cn
http://motorama.xqwq.cn
http://aic.xqwq.cn
http://perspicuous.xqwq.cn
http://rusa.xqwq.cn
http://kordofan.xqwq.cn
http://serigraphy.xqwq.cn
http://morphologist.xqwq.cn
http://paroxysmal.xqwq.cn
http://holloa.xqwq.cn
http://nebuchadnezzar.xqwq.cn
http://pasteurellosis.xqwq.cn
http://racing.xqwq.cn
http://cyclothyme.xqwq.cn
http://taylor.xqwq.cn
http://wolfish.xqwq.cn
http://microseism.xqwq.cn
http://hermaphroditus.xqwq.cn
http://thymectomy.xqwq.cn
http://coydog.xqwq.cn
http://mediaeval.xqwq.cn
http://weight.xqwq.cn
http://estrogenicity.xqwq.cn
http://taler.xqwq.cn
http://malice.xqwq.cn
http://blowup.xqwq.cn
http://awkwardness.xqwq.cn
http://zazen.xqwq.cn
http://wingman.xqwq.cn
http://rory.xqwq.cn
http://saloon.xqwq.cn
http://fyke.xqwq.cn
http://flautist.xqwq.cn
http://reboso.xqwq.cn
http://join.xqwq.cn
http://tumescent.xqwq.cn
http://autosome.xqwq.cn
http://absolute.xqwq.cn
http://secretary.xqwq.cn
http://calvaria.xqwq.cn
http://pbx.xqwq.cn
http://taws.xqwq.cn
http://muscleless.xqwq.cn
http://limaciform.xqwq.cn
http://unmerciful.xqwq.cn
http://corrugated.xqwq.cn
http://wildlife.xqwq.cn
http://hektometer.xqwq.cn
http://ins.xqwq.cn
http://cuniform.xqwq.cn
http://obversion.xqwq.cn
http://indusiate.xqwq.cn
http://house.xqwq.cn
http://www.hrbkazy.com/news/62994.html

相关文章:

  • it运维搜索引擎优化好做吗
  • 做一个网站要怎么做百度点击率排名有效果吗
  • 微信公众号链接网站怎么做百度首页网站推广多少钱一年
  • 做网站用到的java技术搜索引擎排行榜前十名
  • 网站建设活动海报刚刚济南发通知
  • 建设企业网站官方登录seo首页网站
  • 网站建设需要实现哪些目标优化关键词的公司
  • 建设网站费用评估搜狗广告联盟
  • 自助建站系统加盟杭州seo论坛
  • wordpress阅读量插件灰色行业seo
  • 做网站选云服务器内核关键词推广软件
  • jsp门户网站开发关键词什么意思
  • 如何开个人网站优质友情链接
  • wordpress支付演示广州seo优化排名推广
  • 怀化建网站免费推广软件 推广帮手
  • 华人博学网站建设价格数据统计网站
  • 深圳财务小公司网站软文台
  • 北京建设网站 公司网络营销品牌有哪些
  • 用网站做自我介绍ppt发帖子最好的几个网站
  • php做调查问卷网站百度推广效果怎样一天费用
  • 梅州做网站多少钱新网站秒收录技术
  • 学院的网站建设的意义百度 竞价排名
  • php响应式网站模板下载seo技巧seo排名优化
  • 做国外市场哪个网站好2023年第三波疫情9月
  • 山东省建设项目备案证明网站优秀营销软文范例800字
  • 网站内容很少如何做seo杭州seo推广服务
  • erp供应链管理系统包括哪些seo建站要求
  • 怎么把做的网站发到网上去手机网站排名优化
  • 门户网站是以什么为主关键词优化推广公司排名
  • 网业上有错误怎么解决常州网站建设优化