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
Release: 2016-07-13 10:39:13
Original
815 people have browsed it

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...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template