Sometimes, to avoid security issues, we need to compare the source of the submitted Form. Below is an example I wrote that only the submitted form can be passed in! & Amp; lt ;? Php // echo $ _ SERVER ['php _ SELF ']. & quot; & amp; lt; br/
Sometimes, to avoid security issues, we need to compare the source of the submitted Form. Below is an example I wrote that only the submitted form can be passed in!
"; Echo $ _ SERVER ['http _ referer']."
"; // Return the uri of the previous page // echo $ _ SERVER ['server _ name']."
"; // Return host NAME $ src =" http: // {$ _ SERVER ['server _ name']} {$ _ SERVER ['php _ SELF ']} "; echo $ src; // echo $ src; if ($ _ SERVER ['request _ method'] = 'post') {$ src = "http: // {$ _ SERVER ['server _ name']} {$ _ SERVER ['php _ SELF ']} "; if (strcmp ($ src, $ _ SERVER ['http _ referer']) = 0) {echo "matched";} else {echo "matched ";}} else {echo "submit a form" ;}?>