Subscription via php-script and opt-in-ip

Use this forum to suggest new features, language support, documentation, etc. for OpenEMM's roadmap

Moderator: moderator

jogr
Posts: 4
Joined: Thu Oct 01, 2009 1:56 pm

Subscription via php-script and opt-in-ip

Post by jogr » Thu Oct 01, 2009 2:16 pm

Hi out there,

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);
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.