简体   繁体   English

php发送客户端的http请求

[英]php send http request by client

I have a php page thats coded similiar to this code (show.php) : 我有一个与此代码类似的php页面(show.php):

<?php echo (isset($_POST['form']))?($_SERVER['REMOTE_ADDR'];):('not sent') ?> and I have a page (send.php) that send data to show.php using curl <?php echo (isset($_POST['form']))?($_SERVER['REMOTE_ADDR'];):('not sent') ?>我有一个页面(send.php)发送数据到show.php使用curl

when user request the show.php , server show server's ip , but I want to show user's IP , I don't want to send data by HTML , can I use php to solve this problem ?! 当用户请求show.php,服务器显示服务器的ip,但我想显示用户的IP,我不想通过HTML发送数据,我可以用php来解决这个问题吗?

thank you . 谢谢 。

You can add the users IP address to the POST variables that get sent when accessing the send.php page using curl. 您可以将用户IP地址添加到使用curl访问send.php页面时发送的POST变量。

depending on your code there are different methods to accomplish this. 根据您的代码,有不同的方法来完成此任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM