Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function add_member()
- {$WhereTo = trim(stripslashes($_POST['WhereTo']));
- $SerenUsername = trim(stripslashes($_POST['Seren-Crafters-Username']));
- $SerenPassword = trim(stripslashes($_POST['Seren-Crafters-Password']));
- $Email = trim(stripslashes($_POST['Email']));
- $Ques1 = trim(stripslashes($_POST['Ques1']));
- $Answer1 = trim(stripslashes($_POST['Answer1']));
- $Ques2 = trim(stripslashes($_POST['Ques2']));
- $Answer2 = trim(stripslashes($_POST['Answer2']));
- $MailingList = $_POST['MailingList'];
- if ($WhereTo == "" || $SerenUsername == "" || $SerenPassword == "" || $Email == "" || $Ques1 == "" || $Answer1 == "" || $Ques2 == "" || $Answer2 == "")
- {html_head('- Error');
- html_body();
- echo <<<FormError
- <center>
- <img src="/crafted/crafting-search.jpg" height="61" width="336" alt="Serenitee's Crafting Search" class="imgSpacer">
- <table border="0" width="60%" cellpadding="2" cellspacing="0" class="border">
- <tr><th class="headTH">Incomplete Form</th></tr>
- <tr>
- <td align="center">
- <table border="0" width="100%" cellpadding="20" cellspacing="2">
- <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>
- </td>
- </tr>
- </table>
- </center>
- FormError;
- die();}
- $UserCount = "0";
- //check to see if user exists
- $UserExist = mysql_query("SELECT*FROM seren_crafting_users WHERE Username='$SerenUsername'") or die(mysql_error());
- $UserCount = mysql_num_rows($UserExist);
- if ($UserCount != "0")
- {html_head('- Error');
- html_body();
- echo <<<UserTaken
- <center>
- <img src="/crafted/crafting-search.jpg" height="61" width="336" alt="Serenitee's Crafting Search" class="imgSpacer">
- <table border="0" width="60%" cellpadding="2" cellspacing="0" class="border">
- <tr><th class="headTH">Username Already in Use</th></tr>
- <tr>
- <td align="center">
- <table border="0" width="100%" cellpadding="20" cellspacing="2">
- <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>
- </td>
- </tr>
- </table>
- </center>
- UserTaken;
- die();}
- $JoinIP = $_SERVER['REMOTE_ADDR'];
- $JoinDate = date(dMY);
- if ($MailingList != "yes")
- {$MailingList = "no";}
- //if user does not exist, add user
- $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','','')";
- echo mysql_error();
- mysql_query($query);
- $UserInfo = mysql_query("SELECT*FROM seren_crafting_users WHERE Username='$user' AND Password = '$pass'") or die(mysql_error());
- while($row = mysql_fetch_array($UserInfo))
- {$UsernameDB=mysql_result ($UserInfo, $r, "Username");
- $PasswordDB=mysql_result ($UserInfo, $r, "Password");
- $UserID=mysql_result ($UserInfo, $r, "UserID");
- setcookie('Seren-Crafters-Username', $SerenUsername, time()+60*60*24*365, '/', '.kindred-daoc.net');
- setcookie('Seren-Crafters-Password', md5($SerenPassword), time()+60*60*24*365, '/', '.kindred-daoc.net');
- setcookie('Seren-Crafters-UserID', $UserID, time()+60*60*24*365, '/', '.kindred-daoc.net');}
- header("Location: /crafted/manage/index.php");
- die();}
Add Comment
Please, Sign In to add comment