background image

  
  'company'=>urlencode($institution),
  
  'age'=>urlencode($age),
  
  'email'=>urlencode($email),
  
  'phone'=>urlencode($phone)
  
  );
  
  //url-ifythedataforthePOST
  
 

 

foreach($fieldsas$key=>$value){$fields_string.=$key.'='.

$value.'&';}
  
  rtrim($fields_string,'&');
  
  //openconnection
  
  $ch=curl_init();
  
  //settheurl,numberofPOSTvars,POSTdata
  
  curl_setopt($ch,CURLOPT_URL,$url);
  
  curl_setopt($ch,CURLOPT_POST,count($fields));
  
  curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
  
  //executepost
  
  $result=curl_exec($ch);
  
  //closeconnection
  
  curl_close($ch);