你们能帮我在表单提交和电子邮件确认后重定向吗?这是一个酒店预订代码。我已经尝试了几乎所有的东西......我在这个论坛上搜索了很多东西,但我无法解决我的问题:(((
<input type="submit" name="submit" class="btn btn-primary">
<?php
if ( isset( $_POST['submit'] ) ) {
$code1 = $_POST['code1'];
$code = $_POST['code'];
if ( $code1 != "$code" ) {
$msg = "Invalide code";
} else {
$con = mysqli_connect( "localhost", "root", "", "hotel" );
$check = "SELECT * FROM roombook WHERE email = '$_POST[email]'";
$rs = mysqli_query( $con, $check );
$data = mysqli_fetch_array( $rs, MYSQLI_NUM );
if ( $data[0] > 1 ) {
echo "<script type='text/javascript'> alert('User Already in Exists')</script>";
} else {
$new = "Not Conform";
$newUser = "INSERT INTO `roombook`(`Title`, `FName`, `LName`, `Email`, `National`, `Country`, `Phone`, `TRoom`, `Bed`, `NRoom`, `Meal`, `cin`, `cout`,`stat`,`nodays`) VALUES ('$_POST[title]','$_POST[fname]','$_POST[lname]','$_POST[email]','$_POST[nation]','$_POST[country]','$_POST[phone]','$_POST[troom]','$_POST[bed]','$_POST[nroom]','$_POST[meal]','$_POST[cin]','$_POST[cout]','$new',datediff('$_POST[cout]','$_POST[cin]'))";
if ( mysqli_query( $con, $newUser ) ) {
echo "<script type='text/javascript'> alert('Your Booking has been sent,you will receive a confirmation email shortly')</script>" } else {
echo "<script type='text/javascript'> alert('Error adding user in database')</script>";
}
}
$msg = "Your code is correct";
}
}
?>
</form>
</div>
</div>
</div>
</div>````
幕布斯7119047
收到一只叮咚