Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['submit'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $connection = mysqli_connect('localhost', 'root', '', 'loginapp');
- if ($connection) {
- echo "Connected";
- } else {
- die("database failed");
- }
- $query = "INSERT INTO users(username,password)";
- $query .= "VALUES ('$username', '$password')";
- $result = mysqli_query($connection, $query);
- if (!$result) {
- die('query failed' . mysqli_error());
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement