特定端口的php参数
I have a php page http://mydomain.com/mypage.php this page will be accessible by public and our partner. my partner is supposed to send a POST request over port 7333 to http://mydomain.com:7333/mypage.php . now how can i accept the parameters if and only if they came over port 7333. i want to distinguish between parameters that are coming from our partner from params sent by a hacker
Thank you
我有一个php页面 http://mydomain.com/mypage.php 此页面将由公众和我们的合作伙伴访问。 my合作伙伴应该通过端口7333向 http://mydomain.com:7333/mypage.php 。 如果我和如何接受参数? 只有当他们来到7333端口时才会发现。 i想要区分来自我们的伙伴的参数来自黑客发送的参数 p>
谢谢 p> div>
You will have to set up your web server to listen on that port.
See Running different sites on different ports in the Apache manual
This is not possible without system administrator privileges.
Also, it's not good to use a non-standard port for security, at least not if it's the only protection. You should implement some sort of authentication instead!
Couldn't you let the partner send something like data=[...]&secret=gfhshjkfbdnfgezur
to the normal port instead? This string would be the same every time and you would check whether it's the correct one.