title: PHP + Jquery - pass value through ajax to php and check against variable
body: <p>I can't get the following PHP + jQuery to work - all I want the script to do is pass the value through ajax, and get the php to grab it, check it matches and add 1 to score.</p>
  
  <p>This is the code I've written:</p>
  
  <pre><code>&lt;?php
  $score = "1";
  
  $userAnswer = $_POST['name'];
  
  if ($_POST['name'] == "145"){
      $score++;
  }else{
      //Do nothing
  }
  
  echo $score;
  
  ?&gt;
  
  
  &lt;script type="text/javascript"&gt;
  
  $(document).ready(function() {
  
      $("#raaagh").click(function(){
  
      var value = "145";
  
      alert(value);
  
      $.ajax({
          url: 'processing.php', //This is the current doc
          type: "POST",
          data: ({name: value}),
          success: function(){
              location.reload();
         }
      });
  
  
      });
  });
  
  &lt;/script&gt;
  
  &lt;p id="raaagh"&gt;Ajax Away&lt;/p&gt;
  </code></pre>
  
  <p>Thanks for the help, I've changed GET to POST in both instances, and no joy - there's something else wrong.</p>