I've written a php script to register a user for a newsletter.
Code: Select all
$fp = fsockopen("openEMM-server.tld", 8080, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "POST /form.do HTTP/1.1\r\n";
$out .= "Host: www.script-server.tld \r\n";
$out .= "Referer: " . $_SERVER["REMOTE_ADDR"] . "\r\n";
$out .= "Content-type: application/x-www-form-urlencoded\r\n";
$out .= "Content-length: ". strlen($data_to_send) ."\r\n";
$out .= "Connection: Close\r\n\r\n";
$out .= $data_to_send;
fwrite($fp, $out);
This script works fine accept one thing. Checking the new user via Recipients overview I noticed that the opt-in-ip contains the ip of www.script-server.tld.
Is there a chance to change it to the users opt-in ip (which will be given in $_SERVER["REMOTE_ADDR"])
Thanks for help.