cURL script doens't post
Posted: Tue Aug 23, 2011 5:17 pm
Hello everyone
I can not get the following script to post. Did I make a mistake somewhere?
Cheers and thanks
I can not get the following script to post. Did I make a mistake somewhere?
Code: Select all
<?php
//
// A very simple PHP example that sends a HTTP POST to a remote site
//
$post_data = array(
'xnadfjsdp' => '*5tadfafI$',
'xnQ6adfagp' => '*5t6adsfasgVJI$',
'xmadfafD' => 'nGtvadfI-26fghgaha2r6PfafR5kYBU',
'actionType' => 'TGVh4sv',
'First Name' => 'joe',
'Last Name' => 'schmoe',
);
$ch = curl_init();
// set referer:
curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com/");
// This allows you to type google.com and not http://www.google.com
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_URL,"https://crm.zoho.com/crm/WebToLeadForm");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data);
curl_exec ($ch);
curl_close ($ch);
?>