Does not post

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.

IF you show us some code then maybe we can help…


session_start();
error_reporting(E_ALL);
ini_set("display_errors", 1); 


include_once("Connection/mysql.php");  

  $err='';
  $username='';
  $firstname='';
  $lastname='';
  $email='';
  $password='';
  $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 `myMembers` 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 `myMembers` (username,firstname,lastname,email,password,sign_up_date) 
           		VALUES ('".mysql_real_escape_string($_POST["username"])."',
				'".mysql_real_escape_string($_POST["firstname"])."',
				'".mysql_real_escape_string($_POST["lastname"])."',
				'".mysql_real_escape_string($_POST["email"])."',
				'".md5($_POST["password"])."',
				now())")
					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 only thing I may have added is the login form and the registration form but they each have their own php to connect to the db.

This is my form



<td width="786" height="599" valign="top"><form action="log_users.php" method="post" name="login" id="login">
          <div align="left">
            <table width="775" align="center" cellpadding="6" cellspacing="0" style="background-color:#FFF; border:#666 1px solid;">
              <tr>
                <td width="35"><strong><font color="#000000">Email:</font></strong></td>
                <td width="159"><input name="email2" type="text" id="email3" style="width:80%;" /></td>
                <td width="54"><strong><font color="#000000">Password:</font></strong></td>
                <td width="185"><input name="pass" type="password" id="pass" style="width:80%;"/></td>
                <td width="124"><input name="remember" type="checkbox" id="remember" value="yes" checked="checked" />
                  <font color="#000000">Remember Me</font></td>
                <td width="62"><input name="myButton" type="submit" id="myButton" value="Sign In" /></td>
                <td width="70"><a href="http://www.sitepoint.com/forums/yellowbubbles/html/forgot_password.php">Forgot your password?</a></td>
              </tr>
            </table>
          </div>
        </form>
          <form method="post" action="register.php">
            <table width="600" align="center" cellpadding="8" cellspacing="0" style="border:#999 1px solid; background-color:#FBFBFB;">
              <tr>
                <td height="96" colspan="2"><div align="center">
                  <input name="blesslogo" type="image" src="image_header/Blesslogo.jpg" width="80" height="80" border="0" id="blesslogo" />
                </div></td>
              </tr>
              <tr>
                <td colspan="2">&nbsp;</td>
              </tr>
              <tr>
                <td width="122" bgcolor="#FFFFFF">Username:<span class="brightRed"> *</span></td>
                <td width="444" bgcolor="#FFFFFF"><input type="text" name="username" size="35" value="<?php echo htmlspecialchars($username) ?>"/>
                  <span id="nameresponse"><span class="textSize_9px"><span class="greyColor">Alphanumeric 
                    Characters Only</span></span></span></td>
              </tr>
              <tr>
                <td bgcolor="#EFEFEF">First Name:</td>
                <td bgcolor="#EFEFEF"><input type="text" name="firstname" size="35" value="<?php echo htmlspecialchars($firstname) ?>"/>
                  <span id="nameresponse"><span class="textSize_9px"><span class="greyColor">Alphanumeric 
                    Characters Only</span></span></span></td>
              </tr>
              <tr>
                <td>Last Name:</td>
                <td><input type="text" name="lastname" size="35" value="<?php echo htmlspecialchars($lastname) ?>"/>
                  <span id="nameresponse"><span class="textSize_9px"><span class="greyColor">Alphanumeric 
                    Characters Only</span></span></span></td>
              </tr>
              <tr>
                <td bgcolor="#EFEFEF">Email:<span class="brightRed">*</span></td>
                <td bgcolor="#EFEFEF"><input type="text" name="email" size="35" value="<?php echo htmlspecialchars($email) ?>"/></td>
              </tr>
              <tr>
                <td bgcolor="#FFFFFF"> Password:<span class="brightRed">*</span></td>
                <td bgcolor="#FFFFFF"><input name="password" type="password" size="35"/>
                  <span class="greyColor">Alphanumeric Characters 
                    Only</span></td>
              </tr>
              <tr>
                <td bgcolor="#EFEFEF">Human Check:<span class="brightRed">*</span></td>
                <td bgcolor="#EFEFEF"><input name="humanCheck" type="text" class="formFields" id="humanCheck" value="Please remove all of this text" size="32" maxlength="32" /></td>
              </tr>
              <tr>
                <td bgcolor="#FFFFFF">&nbsp;</td>
                <td bgcolor="#FFFFFF"><p><br />
                  <input type="submit" name="submit" value="Submit" />
                </p></td>
              </tr>
            </table>
          </form>


The only thing thats immediately jumping out at me is that you’re testing for a submit button in your isset().

Internet Explorer has a bug (not sure about the latest version) which means that if the cursor is in a text box and you hit enter on the keyboard, the button isn’t submitted. If you click the button with a mouse it is.

IE seems to be the only browser guilty of this, firefox, Seamonkey, cometbird, chrome and netscape were all ok the last time i checked.

I am trying to add in a birthday how do I get it to add to the database.

I have right now.


$err='';
  $username='';
  $password='';
  $firstname='';
  $lastname='';
  $email='';
  $gender='';
  $b_m =$_POST['birth_month'];
  $b_d = $_POST['birth_day'];
  $b_y = $_POST['birth_year'];
$full_birthday = "$b_y-$b_m-$b_d";

       $results = mysql_query("INSERT INTO Members (username,password,firstname,lastname,email,gender,full_birthday,
	   			maritalStatus,country,sign_up_date) 
                    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["full_birthday"])."',	'".mysql_real_escape_string($_POST["country"])."',
	NOW())")
					or die (mysql_error());

In my db I have it as birthday DATE