Advertisement
Guest User

Untitled

a guest
Jan 6th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php
  2.  
  3. Include "Configuration.php";
  4.  
  5. If(LOGGED_IN) Header("Location: Index.php?alert=login_loggedin");
  6.  
  7. If(IsSet($_POST["username"]) && IsSet($_POST["password"]) && IsSet($_POST["verifypassword"])) {
  8.     If(!UserExist(UserName2Id(Secure($_POST["username"])))) {
  9.         If(Md5(Secure($_POST["password"])) == Md5(Secure($_POST["verifypassword"]))) {
  10.             IPLog(Secure($_POST["username"])." registered.");
  11.             $Query = MySQL_Query("INSERT INTO `users` (`id`, `username`, `password`) VALUES(null, '".Secure($_POST["username"])."', '".Md5(Secure($_POST["password"]))."');");
  12.             $_SESSION["id"] = MySQL_Insert_Id();
  13.             Header("Location: Index.php");
  14.         }Else{
  15.             Header("Location: Index.php?alert=register_passwordsunmatch");
  16.         }
  17.     }Else{
  18.         Header("Location: Index.php?alert=register_nametaken");
  19.     }
  20. }Else{
  21.     Header("Location: Index.php?alert=error");
  22. }
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement