if (isset($_POST['submit'])) {
$name=$_POST['name'];
$email=$_POST['email'];
$enquiry=$_POST['enquiry'];
$message=$_POST['message'];
$insert = "insert into contact(name, email, nature, message)
values('$name', '$email', '$enquiry', '$message')";
if(mysqli_query($conn, $insert)) {
header('location: contactus.php');
}
}
我想在联系我们页面上显示弹出框,其中name($name)
用户已通过联系表单提交了他/她的详细信息......!
答案 0 :(得分:0)
尝试header('location: contactus.php?success&name=$name');
并在contactus.php上
if(isset($_GET['success']))
{
$name=$_GET['name'];
echo"<script>window.alert("'.$name.'");</script>";
}
答案 1 :(得分:0)
成功插入后尝试echo "<script>alert(".$name.")</script>"