This topic is locked
[SOLVED]

 After Record Added - transfer data to other software

10/9/2010 7:57:31 AM
PHPRunner General questions
C
crhys author

Hi,
I would like to transfer data into a newsletter management software package after a user is created, I am using Interspire Email Marketer v5.7 which is hosted on the same dedicated server as the domain which contains the PHPRunner app (not that it makes any difference).
I can use a html form to input data into Email Marketer, example code below :-
<form method="post" action="http://www.xxxxxxxxxxxx.co.uk/sendstudioxx/form.php?form=19"; id="frmSS19" onsubmit="return CheckForm19(this);">
<input type="text" name="email" value="" />

<input type="text" name="CustomFields[19]" id="CustomFields_19_19" value="">

<input type="text" name="CustomFields[18]" id="CustomFields_18_19" value="">

<input type="submit" value="Subscribe" />
</form>
I would like to add some code into the After Record Added Event which would pass a few pieces of information (Email address, username, password) etc. and have it transmitted to Email Marketer.
Any Ideas Appreciated
Rhys

Sergey Kornilov admin 10/10/2010

Here is the article that explains how this can be done:

http://www.html-form-guide.com/php-form/php-form-submit.html

C
crhys author 10/10/2010

Thanks for the info, I have managed to make it work, the code is below (somebody might find it handy).
$post_data['CustomFields[19]'] = $values["Username"];

$post_data['CustomFields[18]'] = $values["Password"];

$post_data['email'] = $values["Email"];
foreach ( $post_data as $key => $value) {

$post_items[] = $key . '=' . $value;

}
$post_string = implode ('&', $post_items);
$curl_connection = curl_init('http://www.xxxxxxxxxx.co.uk/sendstudioxx/form.php?form=19';);
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);

curl_setopt($curl_connection, CURLOPT_USERAGENT,

"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");

curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);

curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($curl_connection);

print_r(curl_errno($curl_connection));

curl_close($curl_connection);