vajona Posted November 14, 2010 Share Posted November 14, 2010 I installed phpbb to my site; however i didn't like it so i deleted it. Now my register.php (which hasn't been changed and worked before the phpbb install) will not post data to my database. If someone can help me fix this problem id be most thankful. Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted November 14, 2010 Share Posted November 14, 2010 do you have a backup of your database before you installed phpbb? do you have a control panel like phpMyAdmin or something else so you can look at the database? Quote Link to comment Share on other sites More sharing options...
vajona Posted November 15, 2010 Author Share Posted November 15, 2010 yes i backed my site up and i restored it also. and yes i have a cpanel Quote Link to comment Share on other sites More sharing options...
vajona Posted November 15, 2010 Author Share Posted November 15, 2010 better yet. tell me if there is anything wrong with this as to why it wouldn't be posting data to the database... <?php $submit = $_POST['submit']; //form data $firstname = strip_tags($_POST['firstname']); $lastname = strtolower( strip_tags($_POST['lastname'])); $password = strip_tags($_POST['password']); $repeatpassword = strip_tags($_POST['repeatpassword']); $date = date("Y-m-d"); $email = strip_tags($_POST['email']); $state = strip_tags($_POST['state']); $school = strip_tags($_POST['school']); if ($submit) { //open database $connect = mysql_connect("localhost","USERNAME","PASSWORD")or die("Coundn't connect!"); mysql_select_db("DBNAME") or die("couldn't find db"); //select database $namecheck = mysql_query("SELECT email FROM users WHERE email='$email'"); $count = mysql_num_rows($namecheck); if ($count!=0) { die("Email already registered"); } // email is okay if (stristr($email, '.edu')) { //check for existance if ($firstname&&$lastname&&$password&&$repeatpassword&&$email&&$state&&$school) { if($password==$repeatpassword) { //check char length of lastname and firstname if (strlen($lastname)>25||strlen($firstname)>25) { echo "<b>Lenth of lastname or firstname is too long</b>!"; } else { //check password length if (strlen($password)>25||strlen($password)<6) { echo "<b>Password must be between 6 and 25 characters</b>"; } else { //register the user! // encrypt password $password = md5($password); $repeatpassword = md5($repeatpassword); //generate random number for activation process $random = rand(23456789,98765432); $queryreg = mysql_query(" INSERT INTO users VALUES ('','$firstname','$lastname','$password','$email','$state','$school','$date','$random','0') "); $lastid = mysql_insert_id(); //send activation email $to = $email; $subject = "Activate your account!"; $headers = "From: HEADER"; $server = "localhost"; $port = "465"; $email = "EMAIL ADDRESS"; $password = "PASSWORD"; ini_set("SMTP", $server); $body = " Hello $firstname,\n\n You need to activate your account with the link below: http://www.MYWEBSITE.com/activate.php?id=$lastid&code=$random\n\n Thanks! "; //function to send email mail($to, $subject, $body, $headers); die(" <b>Thank you for registering! Please check your email to activate your account.</b>"); } } } else echo "<b>Your passwords do not match!</b>"; } else echo "<b>Please fill in <u>All</u> Fields!</b>"; } else echo "<b>You must enter your school email to register.</b>"; } ?> 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.