Home > Backend Development > PHP Tutorial > php HTTP_REFERER imitation code (1/2)_PHP tutorial

php HTTP_REFERER imitation code (1/2)_PHP tutorial

WBOY
Release: 2016-07-20 11:09:32
Original
1206 people have browsed it

if (!isset($_server["http_referer"]))
echo "no referer";
else
echo $_server["http_referer "];
?>

If you click the link above directly, the page will display the link to the referer page.
Copy the code as follows:

set http = createobject("msxml2.xmlhttp")
http.open "get","http://www.bkjia.com/test/referer. php",false
http.setrequestheader "referer","http://www.bkjia.com"
http.send
wscript.echo http.responsetext


But If I use vbs to call the msxml2.xmlhttp component to access this page, no referer is returned. This is really unbelievable. Did I write the code wrong?


So I googled "vbs forged http referer" and found that most of the content I found was the same as this article. I copied and pasted it without reading it. You copied mine, and I copied yours. I copied it over and over without knowing who it was, and it was still wrong!
The first example in that article is the asp tutorial


Copy the code as follows:

dim http
set http=server.createobject("msxml2.xmlhttp ")
http.open "get",url,false
http.setrequestheader "referer","http://www.fromdomain.cn/"
http.send()

At first I thought that the vbs under asp was different from the vbs that I directly double-clicked to run. The one under asp was more powerful and I could change the referer. For this reason, I specially installed iis for testing, and found that the returned no referer was still there. Later I saw the following message, "Sorry, I'm not familiar with ASP. I can't help you. Please check other information for reference." "I haven't played with ASP much. The code is just for reference. There is no ASP Tested”.

I really don’t want to curse. If you’re not familiar with it, just write it. At least test it. Are you embarrassed to post the untested code? Later, I saw a relatively reliable answer on Qianyi Network (this network seems to be good). The referer cannot be changed by setting the header in asp and ajax.

I'm angry, since the xmlhttp component doesn't work, I'll use socket to write the head office! (Note: Not all computers have the winsock component registered)


1 2

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/444800.htmlTechArticle?php tutorial if (!isset($_server[http_referer])) echo no referer; else echo $_server[ http_referer]; ? If you click the link above directly, the page will display the link to the referer page. ...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template