I have a website that a user fills out there login information which we then post to another website outside of our system. The website where the information is being posted is doing an IP check. They are trying to check for our server IPs instead of the users IPs. Since the POST is coming from the user, there is no way to get the server IP (that I know of...right?). As a work around for this, I'm trying to initially post to another script on our server which will then repost the information using PHP. This way the IP will be from our server instead of the user.
I've tried using curl, and while that allows me to pull the content of the webpage, it does not redirect the user to the page after the login. I've also tried using header() but I'm pretty sure that solution will not work either. So does anyone know how I can send post information to a website on my server using php and have it send the user to the resulting page?
I've tried something like below however, it only redirects me to the new page with no post data:
$x = curl_init("http://externalsite.com");
curl_setopt($x, CURLOPT_POST, 1);
curl_setopt($x, CURLOPT_POSTFIELDS, $data);
curl_setopt($x, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($x, CURLOPT_REFERER, "site");
curl_setopt($x, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($x);
curl_close($x);
header("Location: http://externalsite.com");
exit;
Thanks