Home >Backend Development >PHP Tutorial >Example of PHP judging normal access and external access_PHP tutorial

Example of PHP judging normal access and external access_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:39:13821browse

PHP determines normal access and external access

Copy code The code is as follows:

session_start();
if(isset($_POST['check'])&&!empty($_POST['name'])){
if($_POST['check'] == $_SESSION['check'] ){
echo "Normal access";
}else{
echo "External access";
}
}
$token = md5(uniqid(rand(),true) );
$_SESSION['check'] = $token;
?>




www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/732388.htmlTechArticlephp determines normal access and external access. Copy the code code as follows: ?php session_start(); if(isset($_POST ['check'])!empty($_POST['name'])){ if($_POST['check'] == $_SESSION['check']){ ec...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn