Jump to content

Problem with CUrl


JesterMike

Recommended Posts

Hi Everyone,

 

I'm working on a php script that will allow me to post data from a Flash form to my email list provider (Vertical Response).

 

In order to accomplish this, I figured I would create an array from the form data and then use CUrl to post that array to Vertical Response. So, I created the script below but it is not working:

<?php

$url = "http://oi.vresp.com";

$fields = array();
$fields['fid'] = "e6ffca61c5";
$fields['email_address'] = $email;
$fields['DOB'] = $year;
$fields['gender1'] = $gender;
$fields['country1'] = $country;
$fields['postalcode'] = $zipcode;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);

$result = curl_exec ($ch);
curl_close ($ch);

?>

 

Can anyone take a look and see if there is something wrong with my formatting?

 

The bottom line is that I am simply looking to have my Flash form push data as follows:

 

http://oi.vresp.com?fid=e6ffca61c5&email_address=$email&DOB=$year&Gender1=$gender&Country1=$country&postalcode=$zipcode

 

Any thoughts?

 

Thanks,

 

Michael Allen

 

 

Link to comment
https://forums.phpfreaks.com/topic/81542-problem-with-curl/
Share on other sites

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.