Home  >  Article  >  Backend Development  >  How to determine the visiting web page address in php_PHP tutorial

How to determine the visiting web page address in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:22:53901browse

How does php determine the address of the visiting web page

How does php determine the address of the visiting web page:

PHP uses the system function "HTTP_REFERER" to determine the visiting web page address

If you register as a user, you must come from a certain website

 $str=@$_SERVER[’HTTP_REFERER’];//@ is the debugging function

 if(strstr($str,www.code-123.com))//

echo "from www.code-123.com";

else

echo "Other URL";

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/845127.htmlTechArticleHow does php determine the address of the visiting web page? How does php determine the address of the visiting web page: php uses the system function HTTP_REFERER to determine the address of the visiting web page, such as When registering a user, it must be $s from a certain URL...
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