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
Share on other sites

  • 1 year later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.