Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form id="contact-form" method="post" action="cms_data.php" role="form">
- <div class="col-sm-12">
- <h2>id</h2>
- <input name="id" type="text" placeholder="<?php echo $id;?>" value="1">
- </div>
- <div class="col-sm-12">
- <h2>Omschrijving</h2>
- <textarea name="omschrijving" type="text" style="height:220px;width:100%;resize:none;"><?php echo $omschrijving;?></textarea>
- </div>
- <div class="col-sm-12">
- <h2>Datum</h2>
- <input name="datum" type="text" value="<?php echo $datum;?>">
- </div>
- <div class="col-sm-12">
- <h2>Tijd</h2>
- <input name="tijd" type="text" value="<?php echo $tijd;?>">
- </div>
- <div class="col-sm-12">
- <h2>Locatie</h2>
- <input name="locatie" type="text" value="<?php echo $locatie;?>">
- </div>
- <div class="col-sm-12">
- <h2>Dresscode</h2>
- <input name="dresscode" type="text" value="<?php echo $dresscode;?>">
- </div>
- <div class="col-sm-12 text-right">
- <input type="submit" class="btn btn-success btn-send" value="Versturen" id="sent" <?php // echo $_SESSION['disabled']; ?>>
- <a href="update-cms.php">Update </a>
- </div>
- </form>
- <?php session_start();?>
- <?php
- $servername = "localhost";
- $username = "xxx";
- $password = "xxx";
- $dbname = "xxx";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- //echo '<div style="width:100%;background:green;color:#FFF;font-size:2rem;text-align:center;">Connected to '. $dbname. '</div>';
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $id = $_POST['id'];
- $omschrijving = $_POST["omschrijving"];
- $datum = $_POST["datum"];
- $item = $_POST["tijd"];
- $locatie = $_POST["locatie"];
- $dresscode = $_POST["dresscode"];
- $quote = iconv("UTF-8", "WINDOWS-1252//TRANSLIT");
- $date = date('Y-m-d');
- date_default_timezone_set("Europe/Amsterdam");
- $time = date("h:i:sa");
- $sql = "INSERT INTO $table (ID, Omschrijving, Datum, Tijd, Locatie, Dresscode )
- VALUES ('" .$id."','" .$omschrijving."','".$datum."',' ".$item."','".$locatie."','".$dresscode."')";
- if ($conn->query($sql) === TRUE) {
- echo "";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $conn->close();
- ?>
- <?php session_start();?>
- <?php
- $servername = "localhost";
- $username = "xxx";
- $password = "xxx";
- $dbname = "xxx";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- //echo '<div style="width:100%;background:green;color:#FFF;font-size:2rem;text-align:center;">Connected to '. $dbname. '</div>';
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $id = $_POST['id'];
- $omschrijving = $_POST["omschrijving"];
- $datum = $_POST["datum"];
- $item = $_POST["tijd"];
- $locatie = $_POST["locatie"];
- $dresscode = $_POST["dresscode"];
- $quote = iconv("UTF-8", "WINDOWS-1252//TRANSLIT");
- $date = date('Y-m-d');
- date_default_timezone_set("Europe/Amsterdam");
- $time = date("h:i:sa");
- $sql = "UPDATE $table SET
- Omschrijving = '$omschrijving', Datum = '$datum', Tijd = '$item', Locatie = '$locatie', Dresscode = '$dresscode' WHERE ID = '1'";
- if ($conn->query($sql) === TRUE) {
- echo "Done";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $conn->close();
- ?>
Add Comment
Please, Sign In to add comment