Unable to access POST variables on the server-side

Unable to access POST variables on the server-side

I am trying to access a variable value. Here is my code:
  1. <script language="javascript" type="text/javascript">
  2.   function UpdateRecord(){
  3.     $.ajax({
  4.       type: "POST",
  5.       url: "test.php",
  6.       data: {name:"EG13291001"},
  7.       success: function(response)
  8.       {
  9.         alert("Success");
  10.       }
  11.     });
  12.   }
  13. </script>
  14. <input type='button' id='button_id' value='Update' onClick='UpdateRecord()'>
Here is my php code(test.php):
  1. <?php
  2. $num = (isset($_POST['name']) ? $_POST['name'] : "unable to access the number");
  3. echo $num;
  4. $link = mysql_connect('abcdef', 'hijklmn', 'opqrstuvwxyz');
  5. mysql_select_db('database', $link) or die(mysql_error());
  6. $db_query = "UPDATE main_table_copy SET `status`='Approve_Final03' WHERE number = '$num'";
  7. ?>

Here, I am unable to access name value. It is just displaying the message "unable to access the number".

What might be the problem?