Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $server = "localhost";
- $username = "username";
- $password = "password";
- $db = "awesome"
- $conn = new mysqli($server, $username, $password, $db);
- if(!$conn){
- die("Die hard: " . mysqli_connect_error());
- }
- ?>
- <html>
- <head>
- </head>
- <body>
- <form method="POST" action="">
- <input type="text" name="username" placeholder="Username">
- <input type="password" name="password" placeholder="Username">
- <input type="submit" name="submit" value="LET ME IN!">
- </form>
- </body>
- </html>
- <?php
- if($_POST['SUBMIT']){
- $saltyness = sha1(md5($_POST['password']));
- $sql = "INSERT INTO users (username, password) VALUES ('$_POST['username']', .'md5($_POST['password'].$saltyness)')";
- if($mysqli_query($conn, $sql)){
- header('Location: http://www.google.dk/');
- } else {
- echo "Error: " . $sql . mysqli_error($conn);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement