Prevent external post submission_PHP tutorial

WBOY
Release: 2016-07-13 17:09:17
Original
1571 people have browsed it

Research on preventing external post submission

I studied the old topic again today:

At present, I think there is only one effective method, picture verification code.

Several other methods that don’t work:
1. Determine HTTP_REFERER. In fact, this information is sent by the browser to the server, so it can be simulated
2. Judge the session code as follows:
session_start();
if(isset($_POST['name']) && !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/629756.htmlTechArticleThe old topic of research on preventing external post submissions was studied again today: At present, I think there is only one effective way. , picture verification code. Several other methods that don't work: 1...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!