-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproceslead.php
38 lines (30 loc) · 901 Bytes
/
proceslead.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require_once('credentials.php');
require_once('lib/cbWebService/WSClient.php');
$client = new Vtiger_WSClient($url);
$client->doLogin($username, $key);
// $leads = $client->doDescribe('Leads');
$values = array(
'firstname' => $_POST['firstname'],
'phone' => $_POST['phone'],
'lastname' => $_POST['lastname'],
'company' => $_POST['companyname'],
'email' => $_POST['email'],
'leadsource' => 'Conference',
'leadstatus' => 'Warm',
'cf_620' => $_POST['interest'],
'code' => $_POST['zipcode']
);
if ($_POST['description'] != '') {
$values['description'] = $_POST['description'];
}
$result = $client->doCreate('Leads', $values);
// echo '<pre>';
// print_r($leads);
// echo '</pre>';
if ($result !== false) {
header('Location: thankyou.php?firstname=' . htmlentities($_POST['firstname']) . '&lastname=' . htmlentities($_POST['lastname']));
} else {
var_dump($result);
}
?>