title: can't insert data into database with php
body: <p>I have writen some code in php for user registration but if i click on submit button It is not writing in database.Please help me.   Here is my code...</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
   &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;Register - Vatsal Technosoft Messenger&lt;/title&gt;
  
      &lt;link href="Style/regstyle.css" rel="stylesheet" type="text/css" /&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;?php include 'connect.php'; ?&gt;
      &lt;?php include 'functions.php'; ?&gt;
  
      &lt;div id="outer"&gt;
          &lt;div id="companyname"&gt;&lt;/div&gt;
  
          &lt;div class="container"&gt;
              &lt;div id="formcontainer"&gt;
                  &lt;h3&gt;Registration Form &lt;/h3&gt;
                  &lt;form name="register_form" action="" method="post"&gt;
  &lt;?php
  if( isset($_POST['register']) AND 
      isset($_POST['username']) AND 
      isset($_POST['password']) AND 
      isset($_POST['firstname']) AND 
      isset($_POST['lastname']) AND 
      isset($_POST['contact1']) AND 
      isset($_POST['address']) AND  
      isset($_POST['jobtitle'])) {
  
          $username = $_POST['username'];
          $password = $_POST['password'];
          $fname = $_POST['firstname'];
          $lname = $_POST['lastname'];
          $con1 = $_POST['contact1'];
          $con2 = $_POST['contact2'];
          $email = $_POST['email'];
          $address = $_POST['address'];
          $jobtitle = $_POST['jobtitle'];
  
      if( empty($username) or 
          empty($password) or 
          empty($fname) or 
          empty($lname) or 
          empty($con1) or 
          empty($email) or 
          empty($address) or 
          empty($jobtitle)) {
  
            $message = "All Information Is neccessary";
  
      } else {
  
          $sql = mysql_query("INSERT INTO users VALUES (``,` $username `,` $password `,` $fname `,` $lname `,` $con1 `,` $address `,` $jobtitle `)");
  
          if($sql) {                  
              $message = "OK....!";       
          } else {       
              $message = "BAD";       
          }
      }
          echo  "&lt;div class='box'&gt; $message &lt;/div&gt;";
      }
  ?&gt;
  
  
                      &lt;div id="formtext"&gt;
                          User Name :     &lt;input type="text" name="username" style="width:200px;" autocomplete="off"/&gt;
                          &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
                          Passwrod  :     &lt;input type="password" name="password" autocomplete="off" style="width:200px;"/&gt;
                          &lt;br /&gt;&lt;br /&gt;
  
                          First Name :    &lt;input type="text" name="firstname"  style="width:200px;" autocomplete="off" /&gt;
                          &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
                          Last Name  :    &lt;input type="text" name="lastname" autocomplete = "off" style = " width:200px; "/&gt;
                          &lt;br /&gt;&lt;br /&gt;
  
                          Contact(1) :    &lt;input type="text" name="contact1" autocomplete="off" style="width:200px;" /&gt;
                          &amp;nbsp;&amp;nbsp;&amp;nbsp;
                          Contact(2) :    &lt;input type="text" name="contact2" autocomplete="off" style="width:200px;"/&gt;
                          &lt;br /&gt;&lt;br /&gt;
  
                          E-mail ID &amp;nbsp;&amp;nbsp;: &lt;input type="text" name="email" autocomplete="off" style="width:300px;"/&gt;
                          &lt;br /&gt;&lt;br /&gt;
  
                          Address :&lt;br /&gt;
                          &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
                          &lt;textarea name="address" cols="25" rows="5" autocomplete="off" style="background: #333;color: #fff;border-radius:5px;border: 0px; margin-top:-20px;" placehoder="Address"&gt;&lt;/textarea&gt;
                          &lt;br /&gt;&lt;br /&gt;
                          Job Title &amp;nbsp;&amp;nbsp;: &lt;input type="text" name="jobtitle" autocomplete="off" style="width:215px;"/&gt;
                          &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
  
                          &lt;input type="button" name="back" value="Back" style="width:100px; margin-left:95px;"/&gt;
                          &lt;input type="reset" name="reset" value="Reset" style="width:100px; margin-left:45px;"/&gt;
                          &lt;input type="submit" name="register" value="Register" style="width:100px; margin-left:45px;"/&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>