Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "gymtastic";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }else{
- echo "Connected <br>";
- }
- if (isset($_POST['value']))
- {
- echo "value bestaat <br>";
- }else{
- echo "value bestaat niet <br>";
- }
- if (isset($_POST['name']))
- {
- echo "name bestaat <br>";
- }else{
- echo "name bestaat niet <br>";
- }
- if (isset($_POST['selection']))
- {
- echo "selection bestaat <br>";
- }else{
- echo "selection bestaat niet <br>";
- }
- if (isset($_POST['heat']))
- {
- echo "heat bestaat <br>";
- }else{
- echo "heat bestaat niet <br>";
- }
- if (isset($_POST['submit'])) {
- $name = $_POST['name'];
- $selection = $_POST['selection'];
- $value = $_POST['value'];
- $heat = $_POST['heat'];
- $sql = "INSERT INTO elements (name, selection, value, heat)VALUES('$name','$selection','$value','heat')";
- if (!mysqli_query($conn, $sql)){
- die('Error: ' . mysqli_error($conn));
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Gymtastic</title>
- <link rel="stylesheet" type="text/css" href="style/style.css">
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- Latest compiled and minified CSS -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <!-- jQuery library -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
- <!-- Latest compiled JavaScript -->
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- </head>
- <body>
- <div class="container">
- <div class="row">
- <div class="col-md-12">
- <div class="title">
- <h1>Gymtastic</h1>
- </div>
- </div>
- </div>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment