jogr
Joined: 01 Oct 2009 Posts: 1
|
Posted: Thu Oct 01, 2009 1:16 pm Post subject: Subscription via php-script and opt-in-ip |
|
|
Hi out there,
I've written a php script to register a user for a newsletter.
| Code: | $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); |
where $data_to_send contains the data to add the interested user in openemm.
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. |
|