mautic-form-submit
mautic-form-submit copied to clipboard
Instead of the user's ip address, I get the ip address of the application server
Hi John! I use mautic-form-submit to receive requests from https://tilda.cc - everything is ok except the user's ip address. Instead of the user's ip, I get the address of the server https://tilda.cc on which the site is located
what am I doing wrong?
John?
Sorry, I forgot about this library. Hard to tell what's wrong. If you share your code I can review if I spot something wrong. Otherwise I'm not sure how to help.
Hi, this is webhook code
<?php
$email = $_REQUEST['email'] ?? $_REQUEST['Email']; // mauticform_input_mkregistraciaslp_email
$name = $_REQUEST['name'] ?? $_REQUEST['Name']; // mauticform_input_mkregistraciaslp_name
$phone = $_REQUEST['phone'] ?? $_REQUEST['Phone']; // mauticform_input_mkregistraciaslp_phone
$location = $_REQUEST['location']; // mauticform_input_mkregistraciaslp_location
$form_id = $_REQUEST['form_id'] ?? $_REQUEST['Form_id']; // mauticform_input_mkregistraciaslp_form_id
file_put_contents('request_log.log', http_build_query($_REQUEST)."\n", FILE_APPEND);
require __DIR__.'/vendor/autoload.php';
use Escopecz\MauticFormSubmit\Mautic;
$mautic = new Mautic('https://ХХХХХХХХХХХ.com');
$form = $mautic->getForm($form_id);
$result = $form->submit(['email' => $email, 'phone' => $phone, 'f_name' => $name, 'location' => $location]);
header('Location: https://ХХХХХХХХХХХ.com/emailconfirm');
?>
and also i post request from form to https://fbe743a59fbdea6215bb45ba360b6fc9.m.pipedream.net
{
"method": "POST",
"path": "/",
"query": {},
"client_ip": "95.213.201.187",
"url": "https://fbe743a59fbdea6215bb45ba360b6fc9.m.pipedream.net/",
"headers": {
"host": "fbe743a59fbdea6215bb45ba360b6fc9.m.pipedream.net",
"content-length": "738",
"user-agent": "Mozilla/5.0 (Linux; Android 10; STK-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36",
"accept": "*/*",
"referer": "https://sever.everest-dom.com/test2?utm_source=google&utm_medium=cpc&utm_campaign=g-14977372311&utm_content=adgroupid-129435240198%7C%7Ccreative-558662021215%7C%7Cplacement-%7C%7Cfeeditemid-%7C%7Cadposition-%7C%7Ctarget-%7C%7Cdevice&utm_term=&gclid=Cj0KCQ",
"content-type": "application/x-www-form-urlencoded"
},
"bodyRaw": "Name=%D0%A8%D0%BE%D1%82%D0%B0&Phone=%2B7+%28909%29+201-46-46&r7_ua=UA-49298821-9&r7_location=%D0%AF%D1%80%D0%BE%D1%81%D0%BB%D0%B0%D0%B2%D0%BB%D1%8C&r7_source_id=sever.everest-dom.com&Email=Ganeevshota%40gmail.com&form_id=35&tranid=2674414%3A3003164311&formid=form388375539&formname=%22%D0%9F%D0%BE%D0%BB%D1%83%D1%87%D0%B8%D1%82%D1%8C+%D0%BF%D0%BE%D0%BB%D0%BD%D1%8B%D0%B9+%D0%BA%D0%B0%D1%82%D0%B0%D0%BB%D0%BE%D0%B3+%D1%81+%D1%86%D0%B5%D0%BD%D0%B0%D0%BC%D0%B8%22+%D0%BD%D0%B0+%D0%BF%D0%B5%D1%80%D0%B2%D0%BE%D0%BC+%D0%B1%D0%BB%D0%BE%D0%BA%D0%B5&utm_source=google&utm_medium=cpc&utm_campaign=g-14977372311&utm_content=adgroupid-129435240198%7C%7Ccreative-558662021215%7C%7Cplacement-%7C%7Cfeeditemid-%7C%7Cadposition-%7C%7Ctarget-%7C%7Cdevice",
"body": {
"Name": "Шота",
"Phone": "+7 (909) 201-46-46",
"r7_ua": "UA-49298821-9",
"r7_location": "Ярославль",
"r7_source_id": "sever.everest-dom.com",
"Email": "[email protected]",
"form_id": "35",
"tranid": "2674414:3003164311",
"formid": "form388375539",
"formname": "\"Получить полный каталог с ценами\" на первом блоке",
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "g-14977372311",
"utm_content": "adgroupid-129435240198||creative-558662021215||placement-||feeditemid-||adposition-||target-||device"
}
}
It looks like a problem in https://github.com/escopecz/mautic-form-submit/blob/master/src/Mautic/Contact.php#L126-L155. Can you take a look and see if it can be improved?
getForm($form_id); $result = $form->submit(['email' => $email, 'phone' => $phone, 'f_name' => $name, 'location' => $location]); header('Location: https://XXXXXXXXXX.com'); ?>
This is standart code from your. I think that mautic writing ip's from server wheare site hosted чт, 20 янв. 2022 г., 19:18 John Linhart @.***>:
Sorry, I forgot about this library. Hard to tell what's wrong. If you share your code I can review if I spot something wrong. Otherwise I'm not sure how to help.
— Reply to this email directly, view it on GitHub https://github.com/escopecz/mautic-form-submit/issues/18#issuecomment-1017675153, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6LCKHUY6EARVBHUIWCRJDUXAYVVANCNFSM4YX5QZZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>