title: Javascript function post and call php script
body: <p>In html I have several buttons which are automatically made for each object in the database with a particular status. Each button gets its own id.</p>
  
  <pre><code>echo '&lt;Button id="button'.$counter.'" onClick="clickedbutton('.$counter.', '.$row['OrderID'].')" &gt;'."&lt;center&gt;".$row['OrderID']."&lt;br&gt;"."&lt;/center&gt;".'&lt;/Button&gt;';
  </code></pre>
  
  <p>The button calls the javascript function clickedbutton and gives it the number of the button and the orderid of that button.</p>
  
  <pre><code>function clickedbutton(buttonid,orderid){
  buttonid = "button" + buttonid;
  
  }
  </code></pre>
  
  <p>This function loads in the number of the button and makes it button0, button1 etc. The orderid is also succesfully passed through. Now in the function I want to call an external php script, but also orderid must be passed through to the script.</p>
  
  <pre><code>&lt;?php
      //connect to database
      include_once('mysql_connect.php');
  
      // Select database
      mysql_select_db("test") or die(mysql_error());
  
      // SQL query
      $strSQL = "update orders set OrderStatus = 'In Progress' where OrderID = '" + orderid + "'";
  
      mysql_close();
  ?&gt;
  </code></pre>
  
  <p>I know about the mysqli protection and all, I will adjust that later. Now I want to focus on the question above, how to call and pass through the variable orderid to the phpscript.</p>