0

I am trying to store data in vtiger leads module. i can send variable via file_get_contents() but its not working . here is my code

$moduleName = $_POST['moduleName']; 
$company    = $_POST['company']; 
$firstname  = $_POST['firstname'];
$lastname   = $_POST['lastname']; 
$website    = $_POST['website']; 
$phone      = $_POST['phone']; 
$email      = $_POST['email']; 
$city       = $_POST['city']; 
$state      = $_POST['state'];
$code       = $_POST['code']; 

$post = http_build_query(array(

"firstname" => "$firstname",
"lastname" => "$lastname",
"website"=>"$website",
"phone"=>"$phone",
"email"=>"$email",
"city"=>"$city",
"state"=>"$state",
"code"=>"$code",
 "moduleName" => "$moduleName",
   "company " => "$company",

));

 $context = stream_context_create(array("http"=>array(
 "method" => "POST",
 "header" => "Content-Type: application/x-www-form-urlencoded\r\n" .
             "Content-Length: ". strlen($post) . "\r\n",  
 "content" => $post,
))); 

$page = file_get_contents("http://vtiger.com/modules/Webforms/post.php", false, $context);

Please help me.

1 Answers1

0

Use web forms correctly, in vtiger 5.4 you can create webforms ealsily with its interface. oru user vtiger webservices to create,edit,delte data

lajeesh k
  • 345
  • 3
  • 12