PHP provides a simple method for obtaining and determining the submission Source. php obtains the submission source. PHP provides a simple method for obtaining and determining the submitted source. the example in this article describes php's simple method for obtaining and determining the submitted source. For your reference, refer to the following simple PHP method for obtaining and determining the submission source, and php method for obtaining the submission source.
This example describes how to obtain and determine the submission source in PHP. We will share this with you for your reference. The details are as follows:
Echo $ _ SERVER ['http _ referer'];
Obtain the url of the previous page.
For example:
$ Url = http://www.weisuyun.com/nihao.html
Other pages submitted are not accepted
The code is as follows:
If (strpos ($ url, 'http: // www.weisuyun.com ') {echo 'source right';} else {echo 'source unknown ';}
The strpos method returns the position where the specified string is located for the first time. if no value is found, false is returned. the subscript starts from 0.
Supplement:
Stripos ()-searches for the position of the string that appears for the first time in another string (case insensitive)
Strripos ()-locate the last occurrence of a string in another string (case insensitive)
Strrpos ()-locate the last occurrence of a string in another string (case sensitive)