Conditions | 6 |
Paths | 4 |
Total Lines | 28 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function __construct() |
||
12 | { |
||
13 | foreach ($_POST as $key => $val) { |
||
14 | $_SESSION[$key] = $val; |
||
15 | } |
||
16 | |||
17 | if (isset($_POST['email_label']) && isset($_POST[$_POST['email_label']]) && isset($_POST['mautic_base_url']) && isset($_POST['form_id'])) { |
||
18 | |||
19 | // It's optional to create a Config DTO object and pass it to the Mautic object. |
||
20 | // For example to set Curl verbose logging to true. |
||
21 | $config = new Config; |
||
22 | $config->setCurlVerbose(true); |
||
23 | |||
24 | $mautic = new Mautic($_POST['mautic_base_url'], $config); |
||
25 | $form = $mautic->getForm($_POST['form_id']); |
||
26 | |||
27 | $info = $form->submit( |
||
28 | [ |
||
29 | $_POST['email_label'] => $_POST[$_POST['email_label']], |
||
30 | ] |
||
31 | ); |
||
32 | |||
33 | $_SESSION['info'] = $info; |
||
34 | } |
||
35 | |||
36 | header(rtrim('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], '/controller.php')); |
||
37 | die(); |
||
38 | } |
||
39 | } |
||
43 |