對于我下面的代碼,我通過使用 href 方法從另一個頁面按下來傳遞 4 個參數(shù)。有了這個,在這段代碼中,我使用 GET 方法來接收所有這 4 個值,并讓它們在不同的值下回顯。但是,當(dāng)我想通過按標題返回我的 index.php 時,它不會將我定向到該頁面。它引導(dǎo)我到 bookingdays.php/index.php,即使它應(yīng)該引導(dǎo)我的正確鏈接是 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>
想要重定向回 index.php
慕妹3242003
2022-01-07 20:51:14
