Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'mysql.php';
- if ( isset($_POST['send']) )
- {
- $user = $_POST['username'];
- $hash = md5('asdf'+md5($_POST['password']);
- $query = "SELECT 'username'
- FROM 'users'
- WHERE 'username'='$user'
- LIMIT 1";
- $result = mysql_query($query) or
- die(mysql_error());
- if ( $row = mysql_fetch_array($result) )
- {
- extract($row);
- if ($username==$_POST['username'])
- echo '<font style="text-color: #FF0000">Username is already in use!</font><br />';
- else
- {
- $query = "INSERT INTO users ('username', 'password')
- VALUES ('$_POST['username']', '$hash')";
- $result = mysql_query($query) or
- die(mysql_error());
- }
- }
- }
- ?>
- <html>
- <head>
- <title>Create new account</title>
- </head>
- <body>
- <form action="newaccount.php" method="POST">
- <div>
- Username: <input type="text" name="username" /><br />
- Password: <input type="password" name="pass" /><br />
- <input type="Submit" name="send" value="Submit" />
- </div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement