<?php
//Get your auth code through the ZoHo
$auth = 'my api key here';
$name='nit';
$surname='test';
$email='n@gmail.com';
// This is a very basic lead.
$xml = '<Leads>
<row no="1">
<FL val="Lead Source">Website</FL>
<FL val="First Name">'.$name.'</FL>
<FL val="Last Name">'.$surname.'</FL>
<FL val="Email">'.$email.'</FL>
</row>
</Leads>';
//Initialize connection
$ch = curl_init('https://crm.zoho.com/crm/private/xml/Leads/insertRecords');
//standard i/o streams
curl_setopt($ch, CURLOPT_VERBOSE, 1);
// Turn off the server and peer verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
//Set to return data to string ($response)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);//Regular post
//Set post fields
$query = "authtoken={$auth}&scope=crmapi&xmlData={$xml}";
// Set the request as a POST FIELD for curl.
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
//Execute cUrl session
$response = curl_exec($ch);
print_r($response);
curl_close($ch);
?>