I am trying to load content from a remote URL in my php code. There are two restrictions:
-
I need to use the dedicated server IP I have so the REMOTE_ADDR of the other server has to be my dedicated IP. This eliminates Curl because Curl uses a proxy to load the remote URL and the proxy changes the IP address which does not work.
-
I need to load the data on my back-end using PHP. I do not wish to use Javascript for security reasons.
Are there any other solutions other then Curl?
Thank you
When using the stream api and a wrapper that utilizes the socket-wrapper you can set the bindto context parameter to accomplish (1) :