对于我下面的代码,我通过使用 href 方法从另一个页面按下来传递 4 个参数。有了这个,在这段代码中,我使用 GET 方法来接收所有这 4 个值,并让它们在不同的值下回显。但是,当我想通过按标题返回我的 index.php 时,它不会将我定向到该页面。它引导我到 bookingdays.php/index.php,即使它应该引导我的正确链接是 index.php。请帮助我,谢谢!
<?php
if($_GET != NULL){
$price = $_GET['price'];
$duration= $_GET['duration'];
$car = $_GET['car'];
$imgLink=$_GET['image'];
}
else{
header("location:index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="img/CarRent.ico" >
<title>Booking | Kereta Sewa Bajet</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/4.7.0/css/font-awesome.min.css">
<style>
.booking-box{
width: 400px;
border: 2px solid #2c3e50;;
padding: 10px;
margin: 5% auto 0;
border-radius:10px;
}
input[type="number"]{
width: 160px;
height: 30px;
}
input[type="date"]{
width: 160px;
height: 30px;
}
input[type="submit"]{
width: 320px;
height: 30px;
}
.btn-green{
border-radius:10px;
color: white;
background-color: #27ae60;
}
.btn-red{
border-radius:10px;
color: white;
background-color: red;
}
body, html {
height: 100%;
line-height: 1.8;
}
.w3-bar .w3-button {
padding: 16px;
}
input[type="text"]{
width: 160px;
height: 30px;
}
</style>
</head>
<body>
哔哔one
相关分类