Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <style>
- table, th, td {
- border: 1px solid black;
- }
- </style>
- </head>
- <body>
- <div>
- <a style="font-size: 50px" href="login.php">π</a>
- </div>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "admin";
- $dbname = "biografiedb";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT id, full_name, email_adres, bericht FROM oke";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- echo "<table><tr><th>ID</th><th>Name</th><th>Email</th><th>Bericht</th></tr>";
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo "<tr><td>" . $row["id"]. "</td><td>" . $row["full_name"]. "</td><td>" . $row["email_adres"]."</td><td>" . $row["bericht"]. "</td> . </tr>";
- }
- echo "</table>";
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
- </body>
- </html>
- ------------------------------------
- <?php
- if(isset($_POST['full_name'])){
- $servername = "localhost";
- $username = "root";
- $password = "admin";
- $dbname = "biografiedb";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $sql = "INSERT INTO oke (full_name, email_adres, bericht)
- VALUES ('".$_POST['full_name']."', '".$_POST['email_adres']."', '".$_POST['bericht']."')";
- if (mysqli_query($conn, $sql)) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . mysqli_error($conn);
- }
- mysqli_close($conn);
- }
- ?>
- <html>
- <head>
- <title></title>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body class="bodycontact">
- <header>
- <div>
- <h1 class="h1">
- <a href="index.php">JEFFREY ROERING</a>
- </h1>
- </div>
- <div>
- <h3 class="h3">
- <a href="biografie.php">BIOGRAFIE</a>
- <a href="contact.php">CONTACT</a>
- <a href="login.php">AANMELDEN</a>
- </h3>
- </div>
- <br/><br/>
- <div>
- <div class="blurb">
- <div style=''>
- <form class="formcontact" action="contact.php" method="post">
- <fieldset style="text-align:">
- <legend>Contact Jeffrey Roering</legend>
- <label for="full_name">Naam:</label>
- <input class="contactinput" type="text" name="full_name"/>
- <br/><br/>
- <label for="email_adres">Uw email:</label>
- <input class="contactinput" type="text" name="email_adres"/>
- <br/><br/>
- <label for="bericht">Bericht:</label>
- <textarea name="bericht" cols="49" rows="6"></textarea>
- <br/><br/>
- <!--<select>
- <option>2017</option>
- <option>2018</option>
- <option>2019</option>
- </select>
- <br/><br/>-->
- <input class="button button1" type='submit' name='submit' value='Send' />
- <br/>
- </fieldset>
- </form>
- </div>
- </div>
- </header>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement