我正在尝试用表格获取数据,用gtag\u report\u转换跟踪adwords
我的代码:
<form id="form1" method="post" enctype="multipart/form-data" role="form" autocomplete="off">
<ul class="form-box">
<li>
<input name="adi" type="text" id="adi" class="form-text" required="required" placeholder="Adınız" />
</li>
<li>
<input name="mesaj" type="text" id="mesaj" class="form-text" required="required" placeholder="Soyadınız" />
</li>
<li>
<input name="telefon" type="tel" id="telefon" class="form-text" required="required" placeholder="Telefon" />
</li>
<li>
<input name="mail" type="email" id="mail" class="form-text" required="required" placeholder="E-Posta" />
</li>
<li class="izin">
<input type="checkbox" required="required" checked> <a href="javascript:;" data-fancybox="modal" data-src="#bilgilendirme-modal">İletişim sözleşmesini </a> okudum,
<br> kabul ediyorum.
</li>
</ul>
</form>
<button type="submit" name="submit" form="form1" class="form-submit" value="Submit" onclick="return gtag_report_conversion('http://localhost/thanks.php');">GÖNDER</button>
我正在mysql上保存数据。
这是同一页的代码。
if(isset($_POST['submit']))
{
$adi = $_POST["adi"];
$telefon = $_POST["telefon"];
$mail = $_POST["mail"];
$mesaj = $_POST["mesaj"];
$tarih = date("d.m.Y");
$ip = $_SERVER['REMOTE_ADDR'];
$stmt = $DB_con->prepare("INSERT INTO iletisim_formu (adi,telefon,mail,mesaj,tarih,ip) VALUES ('" . $adi. "','" . $telefon. "','" . $mail. "','" . $mesaj. "','" . $tarih. "','" . $ip. "')");
$stmt->execute();
}
当我在按钮上写的时候
onclick=“return gtag\u report\u转换('http://localhost/thanks.php');"
它将进入感谢页面,但不会保存到数据库。当我移动它,它保存到数据库,但我不能使用gtag。
怎么了?
我该怎么做才对?
暂无答案!
目前还没有任何答案,快来回答吧!