Home  >  Article  >  Backend Development  >  Prevent external post submission_PHP tutorial

Prevent external post submission_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:09:171572browse

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...
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