title: Jquery + PHP - AJAX onclick favorite/unfavorite
body: <p>So far I have tried using a simple php GET request as well as a POST request, nothing seems to work.</p>
  
  <p>Here is the Javascript code I have thus far:</p>
  
  <pre><code>$(document).ready(function() {
  
  favGame();
  
  // Favorite Link //
  function favGame() {
  
      $("a.arfavorite").click(function() {
          $.get("favorites.php", {gid: gid, ar: ar}, function() {
              alert("it all worked");
          });
          return false;
      });
  } });
  </code></pre>
  
  <p>Here is the PHP code I have thus far:</p>
  
  <p><pre>
   if (!isset($favorites[$game['id']])) {
      echo "Add To My Favorites";
  } else {
      echo "Remove From My Favorites";
  }
     </pre></p>