Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="UTF-8">
- </head>
- <body>
- <form method="post">
- ImiÄ™:<br>
- <input type="text" name="name"><br>
- Nazwisko:<br>
- <input type="text" name="surname"><br>
- <input type="submit">
- </form>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "mydb";
- $name = $_POST["name"];
- $surname = $_POST["surname"];
- $sql = "INSERT INTO users (name, surname)
- VALUES ('$name', '$surname')";
- $conn = new mysqli($servername, $username, $password, $dbname);
- $conn->query($sql);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement