-1

I need to make a http get request in php. So far I have the php go to the url and login via the username and password parameters.

However the url I am trying to access generates a token using my ip. However this generates the token using the ip of my webserver that is making the request. How can I make it use the ip of whatever device is accessing the file and almost forward it on?

Is this possible?

2 Answers2

0

You can use

$userIp = $_SERVER['REMOTE_ADDR'];
Nick
  • 138,499
  • 22
  • 57
  • 95
0

$_SERVER['REMOTE_ADDR'] contains the IP address of the remote host requesting the page.

AC2MO
  • 1,627
  • 13
  • 15