Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Registered!</title>
- </head>
- <body>
- <?php
- error_reporting(E_ALL);
- ini_set('display_errors', 1);
- define('DB_SERVER', 'localhost');
- define('DB_USERNAME', 'username');
- define('DB_PASSWORD', 'password');
- define('DB_DATABASE', 'database');
- $db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
- if(isset($_POST['submit']))
- {
- $name = $_POST['username'];
- $password = $_POST['password'];
- $email = $_POST['email'];
- $username = mysqli_real_escape_string($db, $name);
- $email = mysqli_real_escape_string($db, $email);
- $password = mysqli_real_escape_string($db, $password);
- $query = mysqli_query($db, "INSERT INTO users (username, password,
- email)VALUES ('$name', '$password', '$email')");
- if($query)
- {
- echo "You are now registered!";
- }
- else {
- {
- echo "failed";
- }
- }
- }
- ?>
- </body>
- </html>
- <div id="id01" class="modal">
- <form class="modal-content animate" action="reg.php" method="post">
- <div class="container">
- <label><b>Username</b></label>
- <input type="text" placeholder="Enter Username" id="username"
- name="username" required>
- <label><b>Password</b></label>
- <input type="password" placeholder="Enter Password" id="password"
- name="password" required>
- <label><b>Email</b></label>
- <input type="text" placeholder="Enter Email" id="email" name="email"
- required>
- <button class="btn waves-effect waves-light teal lighten-1" type="submit"
- name="submit" id="submit" value="submit">Submit<i class="material-icons
- right">send</i></button>
- </div>
- </form>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement