Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'connect.php';
- define('salt','7hPqMO(m=F+!!L6(#Yhp-CdF, &Q}+cIrA;c@wcP(E--V<qRmq!v*aSnM;H=4cD0');
- if(isset($_POST['username']) && isset($_POST['fullname']) && isset($_POST['email']) && isset($_POST['password'])) {
- $username = mysql_real_escape_string($_POST['username']);
- $fullname = mysql_real_escape_string($_POST['fullname']);
- $email = mysql_real_escape_string($_POST['email']);
- $password = mysql_real_escape_string($_POST['password']);
- $encryptedPassword = hash( 'whirlpool',salt.$password );
- $sql="INSERT INTO `users` (username, fullname, email, password)
- VALUES
- ('$username', '$fullname','$email','$encryptedPassword')";
- if(!mysql_query($sql,$connection)) {
- die('Error: ' . mysql_error());
- } else {
- mysql_close($connection);
- header('Location: login.php?redirectedFromRegister=1');
- }
- }
- ?>
- <html>
- <body>
- <form action="index.php" method="post">
- <h1>REGISTER</h1><hr/>
- Email: <input type="text" name="email"/><br/>
- Full Name:<input type="text" name="fullname"/><br/>
- Username: <input type="text" name="username"/><br/>
- Password: <input type="password" name="password"/><br/>
- <input type="submit" value="REGISTER"/>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement