Support » Plugins » Processing registration form via PHP

  • I’m trying to find a way to process the form via PHP.

    I have users registering to a newsletter with Aweber and I get their name and email through GET.

    So, I’m trying to process it with cURL.

    Here’s the code I’ve got so far. It’s basically a copy and paste from something I found on the web.

    //create array of data to be posted
    $post_data['email'] = $_GET['email'];
    $post_data['name'] = $_GET['name'];
    //traverse array and prepare data for posting (key1=value1)
    foreach ( $post_data as $key => $value) {
        $post_items[] = $key . '=' . $value;
    //create the final string to be posted using implode()
    $post_string = implode ('&', $post_items);
    //create cURL connection
    $curl_connection =
    //set options
    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);
    //set data to be posted
    curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
    //perform our request
    $result = curl_exec($curl_connection);
    //show information regarding the request
    //echo curl_errno($curl_connection) . '-' .
    //close the connection
  • The topic ‘Processing registration form via PHP’ is closed to new replies.