我已经联系了......本应该将用户重定向到“谢谢”页面,一旦提交了相同的详细信息;然而,在提交..用户没有被引导到“谢谢你”页面。你能找出错误吗?我会非常感激..非常感谢你!当我提交我的联系表时
<?php
include("company_profile/lib/data.config.php");
$btnsubmit =isset($_POST['btnsubmit'])?$_POST['btnsubmit']:'';
if(isset($_POST['btnsubmit']))
{
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$cource = $_POST['cource'];
$message = $_POST['message'];
$created_date = date('Y-m-d');
$time = date('H:i:s');
$q="Insert INTO enquiry_form SET name='$name',email='$email',
contact='$phone',message='$message',cource='$cource',
created_date='$created_date',etime='$time'";
$r = mysqli_query($conn,$q);
if($r)
{
//echo "Thankyou for Inquery";
header("location:thanks.php");
//echo "<script>alert('Message Send')</script>";
}else
{
echo "there was a problem";
}
}
?>
查询syntaxe pb ...并看看SQL注入... https://phpdelusions.net/sql_injection – Incognito
有一件事'$ btnsubmit = isset($ _ POST ['btnsubmit'])?$ _ POST [ 'btnSubmit按钮']: '';如果(isset($ _ POST ['btnsubmit']))'你不应该这样做,第二;哪里的html表单呢? –
你对SQL注入攻击很有信心,如果你还没有,你会被黑客攻击**。不要将任意数据直接连接到查询中。使用PDO或类似的绑定参数。 – Brad