title: Drupal: Ajax post getting internal server error
body: <p>I cannot figure out why the following is giving out internal server error. I can see on console log that I am getting the value, but I can not pass it for some reason.</p>
  
  <pre><code>mav_id = document.getElementById("mav_id");
  var teamName  = mav_id.value;
  
  
   jQuery.ajax({
      type: "POST",
       url: 'http://xx.xxx.xxx.xxx/sites/all/modules/insert.php',
      dataType: 'json',
      data:  teamName,
  
      success: function (obj, textstatus) {
                    if( !('error' in obj) ) {
                        yourVariable = obj.result;
                    }
                    else {
                        console.log(obj.error);
                    }
              }
  });
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>    &lt;?php
      if(isset($_POST['teamName']) or isset($_POST['data'];))
      {
     connector info
          }
  
        $sql = 'INSERT INTO [mydb].[dbo].[team]
      VALUES (2,3)';
      mssql_query($sql, $link);
      }
      else 
        $sql = 'INSERT INTO INSERT INTO [mydb].[dbo].[team]
      VALUES (0,0)';
      mssql_query($sql, $link);
      ?&gt;
  </code></pre>
  
  <p>All I get is:</p>
  
  <blockquote>
    <p>POST <a href="http://xx.xxx.xxx.xxx/sites/all/modules/insert.php" rel="nofollow noreferrer">http://xx.xxx.xxx.xxx/sites/all/modules/insert.php</a> 500 (Internal Server Error) </p>
  </blockquote>