Guest User

Untitled

a guest
Jun 19th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. function add_member()
  2. {$WhereTo = trim(stripslashes($_POST['WhereTo']));
  3. $SerenUsername = trim(stripslashes($_POST['Seren-Crafters-Username']));
  4. $SerenPassword = trim(stripslashes($_POST['Seren-Crafters-Password']));
  5. $Email = trim(stripslashes($_POST['Email']));
  6. $Ques1 = trim(stripslashes($_POST['Ques1']));
  7. $Answer1 = trim(stripslashes($_POST['Answer1']));
  8. $Ques2 = trim(stripslashes($_POST['Ques2']));
  9. $Answer2 = trim(stripslashes($_POST['Answer2']));
  10. $MailingList = $_POST['MailingList'];
  11.  
  12. if ($WhereTo == "" || $SerenUsername == "" || $SerenPassword == "" || $Email == "" || $Ques1 == "" || $Answer1 == "" || $Ques2 == "" || $Answer2 == "")
  13. {html_head('- Error');
  14. html_body();
  15.  
  16. echo <<<FormError
  17. <center>
  18. <img src="/crafted/crafting-search.jpg" height="61" width="336" alt="Serenitee's Crafting Search" class="imgSpacer">
  19. <table border="0" width="60%" cellpadding="2" cellspacing="0" class="border">
  20. <tr><th class="headTH">Incomplete Form</th></tr>
  21. <tr>
  22. <td align="center">
  23. <table border="0" width="100%" cellpadding="20" cellspacing="2">
  24. <tr><td><img src="/crafted/images/oops.jpg" alt="Oops" height="62" width="64" align="left"><font color="red"><b>Oops!</b></font> - You missed a spot! Please use your back button and complete all Registration information.</td></tr></table>
  25. </td>
  26. </tr>
  27. </table>
  28. </center>
  29. FormError;
  30. die();}
  31.  
  32. $UserCount = "0";
  33.  
  34. //check to see if user exists
  35. $UserExist = mysql_query("SELECT*FROM seren_crafting_users WHERE Username='$SerenUsername'") or die(mysql_error());
  36. $UserCount = mysql_num_rows($UserExist);
  37.  
  38. if ($UserCount != "0")
  39. {html_head('- Error');
  40. html_body();
  41.  
  42. echo <<<UserTaken
  43. <center>
  44. <img src="/crafted/crafting-search.jpg" height="61" width="336" alt="Serenitee's Crafting Search" class="imgSpacer">
  45. <table border="0" width="60%" cellpadding="2" cellspacing="0" class="border">
  46. <tr><th class="headTH">Username Already in Use</th></tr>
  47. <tr>
  48. <td align="center">
  49. <table border="0" width="100%" cellpadding="20" cellspacing="2">
  50. <tr><td><img src="/crafted/images/oops.jpg" alt="Oops" height="62" width="64" align="left"><font color="red"><b>Oops!</b></font> It seems your choice in Usernames, <b>$SerenUsername</b>, has already been taken. You can either use your back button and chose another Username or, if you think this user may be you, <a href="/crafted/manage/index.php?action=reclaim_pass">reclaim your password</a>.</td></tr></table>
  51. </td>
  52. </tr>
  53. </table>
  54. </center>
  55. UserTaken;
  56. die();}
  57.  
  58. $JoinIP = $_SERVER['REMOTE_ADDR'];
  59. $JoinDate = date(dMY);
  60. if ($MailingList != "yes")
  61. {$MailingList = "no";}
  62.  
  63. //if user does not exist, add user
  64. $query = "INSERT INTO seren_crafting_users VALUES ('','".mysql_real_escape_string($SerenUsername)."','".mysql_real_escape_string(md5($SerenPassword))."','".mysql_real_escape_string($Email)."','".mysql_real_escape_string($Ques1)."','".mysql_real_escape_string($Answer1)."','".mysql_real_escape_string($Ques2)."','".mysql_real_escape_string($Answer2)."','$MailingList','$JoinDate','$JoinIP','','')";
  65. echo mysql_error();
  66. mysql_query($query);
  67.  
  68. $UserInfo = mysql_query("SELECT*FROM seren_crafting_users WHERE Username='$user' AND Password = '$pass'") or die(mysql_error());
  69.  
  70. while($row = mysql_fetch_array($UserInfo))
  71. {$UsernameDB=mysql_result ($UserInfo, $r, "Username");
  72. $PasswordDB=mysql_result ($UserInfo, $r, "Password");
  73. $UserID=mysql_result ($UserInfo, $r, "UserID");
  74.  
  75. setcookie('Seren-Crafters-Username', $SerenUsername, time()+60*60*24*365, '/', '.kindred-daoc.net');
  76. setcookie('Seren-Crafters-Password', md5($SerenPassword), time()+60*60*24*365, '/', '.kindred-daoc.net');
  77. setcookie('Seren-Crafters-UserID', $UserID, time()+60*60*24*365, '/', '.kindred-daoc.net');}
  78.  
  79. header("Location: /crafted/manage/index.php");
  80. die();}
Add Comment
Please, Sign In to add comment