Using curl inside a php application.

Once you've installed phpList... ask questions here!
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation.

Using curl inside a php application.

Postby Praetorian » 5:21pm, Thu 14 Aug, 2014

I have been trying for the last few days to get a curl config that can signup people to the basic subscribe page in place of a basic html signup page. Below is part of my routine that generates no errors but also does not sign up the email to the list specified. I have tried the same email address from the html signup page and it works, but from this php version it does not. I am hoping someone here can point out my problem so I can get this working for a non profit.

Code: Select all

foreach ( $post_data as $key => $value)
$post_items[] = $key."=".$value;
$post_string = implode ('&', $post_items);
echo $post_string."<br>";
$curl_connection = curl_init('');
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)");
curl_setopt($curl_connection, CURLOPT_REFERER, "");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($curl_connection, CURLOPT_VERBOSE, true);
$result = curl_exec($curl_connection);
echo $result."<br>";
echo curl_errno($curl_connection)."<br>";
echo curl_error($curl_connection)."<br>";

phpList newbie
Posts: 2
Joined: 6:28pm, Thu 23 Jan, 2014

Return to Questions and Problems after Installing

Who is online

Users browsing this forum: No registered users and 1 guest