chriscloyd Posted March 27, 2007 Share Posted March 27, 2007 well heres my problem it goes through the whole script with out any errors until the very end the part where it actually enters the info into the mysql database it wont create it at all heres the actually script http://www.chaoslegionclan.net/CEGL-Work/newsite/index.php?p=register <?php include("config.php"); //check required fileds //username password c_password email c_email $reason = array(); $username = $_POST['Username']; $password = $_POST['Password']; $c_password = $_POST['Confirmation_Password']; $email = trim($_POST['Email']); $c_email = $_POST['Confirmation_Email']; $alias = $_POST['Alias']; if (empty($username)) { $reason[] = '-You did not submit a username.'; } if (empty($password)) { $reason[] = '-You did not submit a password.'; } if (empty($c_password)) { $reason[] = '-You did not submit a confirmation password.'; } if (empty($email)) { $reason[] = '-You did not submit a email address.'; } if (empty($c_email)) { $reason[] = '-You did not submit a confirmation email address.'; } if (!empty($reason)) { $reasons = implode("<br>",$reason); header("Location: ../index.php?p=register&error=".$reasons); } else { //check email if ($email != $c_email) { $reason = "-Your email address's dont match."; header("Location: ../index.php?p=register&error=".$reason); } $check_email = mysql_query("SELECT * FROM cegl_users WHERE email = '$email'"); if ($check_email) { $email = mysql_num_rows($check_email); if ($email > 0) { $reason = '-That email address is already in use.'; header("Location: ../index.php?p=register&error=".$reason); } } //check passwords if ($password == $c_password) { $password = md5($password); } else { $reason = '-Your passwords dont match.'; header("Location: ../index.php?p=register&error=".$reason); } //check username $check_username = mysql_query("SELECT * FROM cegl_users WHERE username = '$username'"); if ($check_username) { $user = mysql_num_rows($check_username); if ($user > 0) { $reason = '-That username is already in use.'; header("Location: ../index.php?p=register&error=".$reason); } } /*check alias $check_alias = mysql_query("SELECT * FROM cegl_users WHERE alias = '$alias'"); if ($check_alias) { $user_alias = mysql_num_rows($check_alias); if ($user_alias > 0) { $reason = '-That Alias is already in use.'; header("Location: ../index.php?p=register&error=".$reason); } } */ //step 2 fields $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $month = $_POST['month']; $day = $_POST['day']; $year = $_POST['year']; $birthdate = $month.'/'.$day.'/'.$year; $gender = $_POST['gender']; $location = $_POST['location']; $timezone = $_POST['timezone']; $interests = $_POST['interests ']; $occupation = $_POST['occupation']; //step 3 fields $irc_network = $_POST['irc_network']; $irc_channel = $_POST['irc_channel']; $irc_alias = $_POST['irc_alias']; $website = $_POST['website']; $aim = $_POST['aim']; $msn = $_POST['msn']; $yahoo = $_POST['yahoo']; $icq = $_POST['icq']; $xfire = $_POST['xfire']; $skype = $_POST['skype']; //step 4 fields $manufacturer = $_POST['manufacturer']; $cpu = $_POST['cpu']; $ram = $_POST['ram']; $video_card = $_POST['video_card']; $sound_card = $_POST['sound_card']; $monitor = $_POST['monitor']; $mouse = $_POST['mouse']; $mouse_pad = $_POST['mouse_pad']; $key_board = $_POST['key_board']; //step 5 $bio = nl2br($_POST['bio']); $avatar = $_POST['avatar']; $sig = nl2br($_POST['sig']); //step 6 $news_letters = $_POST['news_letters']; $aup = $_POST['aup']; if ($aup != 'Yes') { $reason = '-You must agree to the <a href="http://www.cegl.net/index.php?p=aup">Acceptable Use Policy</a>.'; header("Location: ../index.php?p=register&error=".$reason); } $possible = '23456789bcdfghjkmnpqrstvwxyz'; $code = ''; $i = 0; while ($i < $characters) { $code .= substr($possible, mt_rand(0, strlen($possible)-1), 1); $i++; } //date $join_date = date('m/d/Y'); //email users $to = $email; $subject = "CEGL - Ciraco Electronic Gaming League"; $message = "Welcome $first_name '$alias' $last_name<br> We want to be the first to welcome you. The Ciraco Electronic Gaming League, CEGL, was created in December 2005 when the CEO, Caleb 'ciraco' Harrod, reached the age of 18 and had become fed up with the corruption of other leagues admins.<br> <br> The primary goal of CEGL is to be the first ever free online gaming league to offer its top teams hardware prizes, and to offer pay-2-play leagues with cash prizes for those more hardcore teams and players.<br> <br> Beginning with only Counter-Strike and Call of Duty, CEGL has been able to successfully host its first season and expand into other games such as Counter-Strike Source, Call of Duty2 and Warcraft3 Defense of the Ancients. CEGL was the first free online league to offer its teams a chance to win hardware prizes along with all of the glory of being a season champion..<br> <br> Below is your activation link<br> <a href='http://www.chaoslegionclan.net/CEGL-Work/newsite/index.php?p=activate&code=$code'>Activate Now</a><br> If that link does not work follow the steps below<br> Step 1: Go to www.chaoslegionclane.net/CEGL-Work/newsite/index.php?p=activate<br> <br> Enter The Code: $code<br> into the field then hit submit<br> <br> Thanks CEGL Staff<br> www.cegl.net"; $from = "CEGL-Accounts@cegl.net"; $headers1 = "MIME-Version: 1.0\r\n"; $headers1 .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers1 .= "To: ".$to."\r\n"; $headers1 .= "From: ".$from."\r\n"; $headers1 .= "Reply-To: ".$from."\r\n"; mail($to, $subject, $message, $headers); //process info $create_account = mysql_query("INSERT INTO `cegl_users` (`user_id`, `username`, `alias`, `first_name`, `last_name`, `gender`, `birthdate`, `location`, `timezone`, `interests`, `occupation`, `access_level`, `last_login`, `join_date`, `email`, `irc_server`, `irc_channel`, `irc_alias`, `website`, `aim`, `yahoo`, `msn`, `xfire`, `skype`, `avatar`, `sig`, `biography`, `password`, `manufacturer`, `cpu`, `ram`, `video_card`, `sound_card`, `monitor`, `mouse`, `mouse_pad`, `key_board`, `news_letters`, `code`, `icq`, `bio`, `status`) VALUES (NULL, '$username', '$alias', '$first_name', '$last_name', '$gender', '$birthdate', '$location', '$timezone', '$interests', '$occupation', 'user', 'none', '$join_date', '$email', '$irc_network', '$irc_channel', '$irc_alias', '$website', '$aim', '$yahoo', '$msn', '$xfire', '$skype', '$avatar', '$sig', '$bio', '$password', '$manufacturer', '$cpu', '$ram', '$video_card', '$sound_card', '$monitor', '$mouse', '$mouse_pad', '$key_board', '$news_letters', '$code', '$icq', '$bio','inactive')"); if ($create_acocunt) { header("Location: ../index.php?p=congrats"); } else { $reason = '-This account could be not made try again.'; header("Location: ../index.php?p=register&error=".$reason); } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.