Answer the question
In order to leave comments, you need to log in
API form script sends only what is in the php file can help solve the problem?
there is a form to which a php script is connected to transfer data from the form, but why is only the data that is transmitted in the php file, that is, the data that the user has filled out is not transmitted, but the information that is in the example php file is sent.
What could be the error in the form or in the php file? Thanks in advance for your reply
<?php
$params = [
"phone" => "+380502421394",
"identCode" => "3439701630",
"employment" => "unofficial",
"firstName" => "Артем",
"lastName" => "Жихарев",
"middleName" => "Владимирович",
"agree" => true,
"url" => "https://ads.google.com",
"city" => "Харьков",
"agreeTime" => "2021-02-09 19:51:02",
"birthDate" => "05.03.1984",
"amount" => 25000
];
$url = 'https://finline.ua/api/lead/create/24/1';
$curl = curl_init();
$params = http_build_query($params);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
var_dump($response);
curl_close($curl);
код формы сайта
<center>
<form id="form" target="_blank" method="post" action="/papa3.php">
<!--Обязательные параметры -->
firstName:<br>+<input id="firstName" style="height: 35px; padding-top: 3px; font-size: 16px; width: 200px;" name="firstName" type="text" value="380"/><br>
Введіть свій middleName:<br>+<input id=" middleName" style="height: 35px; padding-top: 3px; font-size: 16px; width: 200px;" name=" middleName" type="text" value="н"/><br>
Введіть свій номер lastName:<br>+<input id="lastName" style="height: 35px; padding-top: 3px; font-size: 16px; width: 200px;" name="lastName" type="text" value="н"/><br>
Введіть сумму amount:<br>+<input id="lastName" style="height: 35px; padding-top: 3px; font-size: 16px; width: 200px;" name="lastName" type="text" value="н"/><br>
Введіть дату народження:<br>+<input id="birthDate" style="height: 35px; padding-top: 3px; font-size: 16px; width: 200px;" name="birthDate" type="text" value="dd.mm.yyyy"/><br>
Місто,село:<br>+<input id="city" style="height: 35px; padding-top: 3px; font-size: 16px; width: 200px;" name="city" type="text" value="н"/><br>
+<input id="agree" name="agree" value="true"/><br>
<td align="center" colspan="2">Трудоустройство*:
<div><select id="employment" name="employment" style="height:35px;padding-top:3px;font-size:16px; width:180px;"><option class="input" selected="selected" size="40" value="official">Официально трудоустроен</option>
<option class="input" size="40" value="private">СПД/ФЛП</option>
<option class="input" size="40" value="pensioner">Пенсионер</option>
<option class="input" size="40" value="no">Временно не работаю</option><option class="input" size="40" value="maternityLeave">Декретный отпуск</option>
<option class="input" size="40" value="officialPrivate ">официально в фирме через СПД/ФЛП</option>
<option class="input" size="40" value="unofficial">Работаю не официально</option></select></div>
</td>
<td align="center" colspan="2">Цель кредита*:
<div><select id="aim" name="aim" style="height:35px;padding-top:3px;font-size:16px; width:180px;"><option size="40" value="usedCar ">покупка Б/У авто</option>
<option size="40" value="technics ">ремонт/покупка техники, мебели</option><option size="40" value="humanDeposit ">деньги под залог авто</option>
<option size="40" value="cure">Лечение</option>
<option size="40" value="business">На бизнес</option>
<option size="40" value="otherCredit">Погасить другой кредит</option>
<option size="40" value="untilSalary">деньги до зарплаты</option>
<option size="40" value="other">Другое</option> </select></div>
</td>
Введіть свій номер телефону:<br>+<input id="phone" style="height: 35px; padding-top: 3px; font-size: 16px; width: 200px;" name="phone" type="text" value="380"/><br>
Введіть свій ідентифікаційний код::<br><input id="identCode" maxlength="10" style="height: 35px; padding-top: 3px; font-size: 16px; width: 200px;" name="identCode" type="text" maxlength="10" value=""/><br>
<br>
<input name="btn_submit" id="btn_submit" onclick="" target="_blank" src="/wp-content/uploads/2021/03/300-60-PADAT-ZAYAVKU.png" type="image">
</form>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question