php判断正常访问和外部访问的示例
时间:2024-05-11 09:45:46
php判断正常访问和外部访问
<?php
session_start();
if(isset($_POST['check'])&&!empty($_POST['name'])){
if($_POST['check'] == $_SESSION['check']){
echo "正常访问";
}else{
echo "外部访问";
}
}
$token = md5(uniqid(rand(),true));
$_SESSION['check'] = $token;
?>
<form method="post" action="">
<input type="text" name="name"/>
<input type="text" name="check" value="<?=$token;?>">
<input type="submit">
标签:正常访问,外部访问
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python实现简单的购物程序代码实例
2022-09-03 05:29:13
js实现input+select组合 抛砖引玉
2010-08-02 12:34:00
go语言中[]*int和*[]int的具体使用
2024-05-29 22:08:38
python实现五子棋游戏
2021-09-24 13:52:37
![](https://img.aspxhome.com/file/2023/8/99678_0s.jpg)
重新认识vue之事件阻止冒泡的实现
2024-05-10 14:18:34
![](https://img.aspxhome.com/file/2023/6/126416_0s.jpg)
详解MySQL中ALTER命令的使用
2024-01-26 12:27:25
python palywright库基本使用
2021-03-30 17:34:42
Python模块汇总(常用第三方库)
2023-05-21 16:25:37
![](https://img.aspxhome.com/file/2023/4/91864_0s.png)
文本框textarea限制输入文字个数的方法
2008-01-28 13:02:00
一个asp分页源代码例子
2007-09-19 12:25:00
解决tensorflow测试模型时NotFoundError错误的问题
2021-08-02 09:33:56
在mac上如何使用终端打开XAMPP自带的MySQL
2024-01-17 15:41:53
用python实现的去除win下文本文件头部BOM的代码
2021-04-01 08:00:19
python析构函数用法及注意事项
2023-01-25 19:53:11
Python练习之操作SQLite数据库
2024-01-22 03:23:39
![](https://img.aspxhome.com/file/2023/1/79611_0s.png)
Golang CSP并发机制及使用模型
2023-09-15 16:13:27
![](https://img.aspxhome.com/file/2023/4/101674_0s.jpg)
Python2.x与3.x版本有哪些区别
2023-11-01 08:34:31
使用Pytorch构建第一个神经网络模型 附案例实战
2023-10-13 14:40:30
![](https://img.aspxhome.com/file/2023/7/123497_0s.png)
使用python svm实现直接可用的手写数字识别
2023-06-09 13:57:19
![](https://img.aspxhome.com/file/2023/3/99603_0s.jpg)
PHP面向对象教程之自定义类
2024-05-11 09:23:46