验证从同一服务器发送的POST数据而不使用PHP使用令牌?

问题描述:

For reasons beyond the scope of this post, I would like to verify in PHP if post data was sent from the same server, but I would like to avoid using a token. If completely necessary, I can use one, but I would be very helpful if I didn't have to.

Is this possible? If not, why?

Thanks!

由于超出本文范围的原因,我想在PHP中验证是否发送了相同的帖子数据 服务器,但我想避免使用令牌。 如果完全必要的话,我可以使用一个,但如果我不需要,我会非常乐于助人。 p>

这可能吗? 如果没有,为什么? p>

谢谢! p> div>

Yes, you can check the remote address for the IP address of the request sender using $_SERVER['REMOTE_ADDR']. Do it like this:

if( $_SERVER['REMOTE_ADDR'] == $your_Server_IP_Address)
     echo 'From same server';
else
     echo 'from different server';