When writing user registration, be sure to focus on whether your form can be submitted across domains.
Solution in PHP:
1. In addition to doing form verification on the page, you also need to Submit the service segment data for verification.
The main code for verification is as follows:
Copy code The code is as follows:
$servername=$_SERVER['SERVER_NAME' ];//The name of the server host where the script is currently running.
$sub_from=$_SERVER["HTTP_REFERER"];//The URL address of the previous page linked to the current page
$sub_len=strlen($servername);//Statistics on the name length of the server.
$checkfrom=substr($sub_from,7,$sub_len);//Intercept the URL submitted to the previous page, excluding the http::// part.
if($checkfrom!=$servername){
$msg="The data source is wrong! Please submit it from this site!";
$this->redirect("m_index/reg",$ msg);
exit;
}
2. This site closes registration, use development platforms like Xinlang Weibo, Tencent and other development platforms to log in.
3. Configure hostlookups parameters in apache. This is based on performance consumption.
http://www.bkjia.com/PHPjc/825027.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825027.htmlTechArticleWhen writing user registration, be sure to check whether your form can be submitted across domains. Solution in php : 1. In addition to completing table verification on the page, the data of the submitted service segment must also be submitted...
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