rdkd1970 Posted May 28, 2011 Share Posted May 28, 2011 Okay I had a trial form that always added to my db now I copied the same codes just added it to my site and does not post anything. Can someone tell me why it is not working now after so many trials of success. When nothing has changed but the added information like pictures and normal things on my pages. It is supposed to go to my registration-success.php but it just picks up the connecting php to insert to the db and leaves it blank. Quote Link to comment https://forums.phpfreaks.com/topic/237716-does-not-post/ Share on other sites More sharing options...
spiderwell Posted May 28, 2011 Share Posted May 28, 2011 Okay I had a trial form that always added to my db now I copied the same codes just added it to my site and does not post anything. Can someone tell me why it is not working now after so many trials of success. When nothing has changed but the added information like pictures and normal things on my pages. It is supposed to go to my registration-success.php but it just picks up the connecting php to insert to the db and leaves it blank. it worked locally but not on the live site? check the connection details Quote Link to comment https://forums.phpfreaks.com/topic/237716-does-not-post/#findComment-1221596 Share on other sites More sharing options...
fugix Posted May 28, 2011 Share Posted May 28, 2011 sounds like it could be a pathing error Quote Link to comment https://forums.phpfreaks.com/topic/237716-does-not-post/#findComment-1221598 Share on other sites More sharing options...
rdkd1970 Posted May 28, 2011 Author Share Posted May 28, 2011 I put the code and this is what shows up after I add information to the form. text text text All my connections are correct nothing changed I test live with the codes and now I added my same codes that I test live to my index page that has the same form info but with the designs. When I tested the codes that worked it was just the form and the php info that connected to the db and inserted etc. Quote Link to comment https://forums.phpfreaks.com/topic/237716-does-not-post/#findComment-1221611 Share on other sites More sharing options...
mikesta707 Posted May 28, 2011 Share Posted May 28, 2011 why dont you try posting the code so we can take a look Quote Link to comment https://forums.phpfreaks.com/topic/237716-does-not-post/#findComment-1221617 Share on other sites More sharing options...
rdkd1970 Posted May 28, 2011 Author Share Posted May 28, 2011 session_start(); $garbage = 'just some bs <ul><li>text</li><li>text</li><li>text</li></ul>just some more bs'; preg_match_all('/<ul>(.*?)<\/ul>/i', $garbage, $matches); echo $matches[0][0]; include_once ("Connections/connect_to_mysql.php"); $err=''; $username=''; $password=''; $firstname=''; $lastname=''; $email=''; $gender=''; $looking_for=''; $birth_date=''; $maritalStatus=''; $children=''; $wantChildren=''; $ethnic=''; $education=''; $country=''; $bestfriend=''; $humanCheck=''; if(isset($_POST["submit"])){ // Validate form data if($_POST["firstname"]=='') $err.='Please enter First Name<br>'; if($_POST["email"]=='') $err.='Please enter Email<br>'; if($err==''){ // Check if there are duplicate entries in the 'contacts' table $sql_check = mysql_query("SELECT id FROM `Members` WHERE username='".addslashes($_POST["username"])."' and firstname='".addslashes($_POST["firstname"])."' and Email='".addslashes($_POST["email"])."'"); if($row = mysql_fetch_array($sql_check)){ $err.='Can not add duplicate entry<br>'; } else{ // adding new record to 'contacts' table $results = mysql_query("INSERT INTO Members (username,password,firstname,lastname,email,gender,looking_for,birth_date, maritalStatus,children,wantChildren,ethnic,education,country,bestfriend) values ('".mysql_real_escape_string($_POST["username"])."','".md5($_POST["password"])."','".mysql_real_escape_string($_POST["firstname"])."','".mysql_real_escape_string($_POST["lastname"])."','".mysql_real_escape_string($_POST["email"])."','".mysql_real_escape_string($_POST["gender"])."','".mysql_real_escape_string($_POST["looking_for"])."','".mysql_real_escape_string($_POST["birth_date"])."','".mysql_real_escape_string($_POST["maritalStatus"])."','".mysql_real_escape_string($_POST["children"])."','".mysql_real_escape_string($_POST["wantChildren"])."','".mysql_real_escape_string($_POST["ethnic"])."','".mysql_real_escape_string($_POST["education"])."','".mysql_real_escape_string($_POST["country"])."','".mysql_real_escape_string($_POST["bestfriend"])."')") or die (mysql_error()); $id = mysql_insert_id(); $userid = mysql_insert_id(); $_SESSION['id']= $userid; // redirecting to success screen if($results){ header("Location: register-success.php"); }else die(mysql_error()); } } } The rest is the form and the html info. which is how it is gone crazy i guess. Quote Link to comment https://forums.phpfreaks.com/topic/237716-does-not-post/#findComment-1221623 Share on other sites More sharing options...
mikesta707 Posted May 28, 2011 Share Posted May 28, 2011 So what happens exactly? Is an entry entered into the database? Blank page? Nothing happening Quote Link to comment https://forums.phpfreaks.com/topic/237716-does-not-post/#findComment-1221643 Share on other sites More sharing options...
rdkd1970 Posted May 28, 2011 Author Share Posted May 28, 2011 I entered into the form. I have the form going to the register.php which if successful will go to register-success.php. It goes to register.php and does nothing does not add to the db. I used the same coding with a form only and got the results I needed it went to success then let me go to login to the profile page. Now it just stops at register.php with a blank page. Quote Link to comment https://forums.phpfreaks.com/topic/237716-does-not-post/#findComment-1221646 Share on other sites More sharing options...
rdkd1970 Posted May 28, 2011 Author Share Posted May 28, 2011 You know what I did. I just deleted the login form which I had on my index.php with the registration form put in a link to login. Ran the codes for the registration page on index.php and got it to work. so that means for some reason the confusion is with the two forms on the same page. Thanks for all the help. Quote Link to comment https://forums.phpfreaks.com/topic/237716-does-not-post/#findComment-1221650 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.