Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

PHP Posting form to another page

220061

Well-Known Coder
I don't understand what is going wrong here I have a form for my users called reservation.php this one (is supposed to ) goes to reservationback.php but I have been trying it and for some reason it goes to reservation.php?submit=submit why is this happening??
reservation.php this one is suppossed to go to reservationback.php but it's not working

PHP:
php
include "config.php";
if(isset($_POST['bestellen'])){
    ?>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>reservation</title>
        <script src="https://cdn.jsdelivr.net/npm/litepicker/dist/litepicker.js"></script>
        <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <?php include "navbar.php"; ?>
    </head>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        body{
            height: 100%;
            background-color: gray;
            padding-left: 10px;
            padding-right: 10px;
        }
        .container{
            margin-top: 10%;
            padding: 0;
            background-color: yellow;
        }
        .top{
            
            padding: 10px;
            background-color: black;
            color: white;
        }
        .information{
            padding: 10px;
        }
        
    </style>
    <body>
    <form action="reservationback.php" method="POST">
        <div class="container mb-3">
            <div class="top">
            <h2>Reserveren <?php echo $_GET['naam'];?>
            </h2>
            </div>
            <div class="information mb-3">
                    <div class="check in mb-3">
                        <!-- <label for="checkIn" class="form-label">Check in </label>  -->
                            <?php
                            $sql = "SELECT * FROM reserveringen";
                            $stmt = $conn->prepare($sql);
                            $stmt->execute();
                            $result = $stmt->get_result();
                            while ($row = mysqli_fetch_assoc($result)) {
                                echo $row['start_datum']; //start date
                                echo "<br>";
                                echo $row['eind_datum']; //end date
                            }
                            ?>
                            <!-- je moet je eigen kalender maken -->
                    
                        <div class="check in mb-3">
                            <label for="Naam" class="form-label">Naam: </label> 
                            <input type="text" class="form-control" id="Naam"/>
                        </div>
                        <div class="check in mb-3">
                            <label for="Email" class="form-label">Email: </label> 
                            <input type="email" class="form-control" id="Email"/>
                        </div>
                        <div class="check in mb-3">
                            <label for="Telefoonnummer" class="form-label">Telefoonnummer: </label> 
                            <input type="text" class="form-control" id="Telefoonnummer"/>
                        </div>
                        <div class="form-group ">
                            <input type="submit" name="submit" class="btn btn-info btn-md" value="submit">
                        </div>
                </div>
            </div>
        </div>
    </form>
    </body>
    </html>
        
    <?php
}

?>

pic of where it goes to

1653303973317.png
 
Back
Top Bottom