Passing Vars from Jquery to PHP
<p>I was attempting to pass a variable from Jquery to PHP and then I am using that variable on my webpage.  My jquery script is not failing as my alerts all come up, but I seem to have a problem grabbing the variable with my php page as I am getting an "Undefined index name on line 6 error" which is were I using my $_POST call. The Echo test is also working so the php is not hanging up completely.  Here is the code, and thank you for any advice:</p>

<p>edit: Looking in dev view I did notice that the variable is getting passed from the jquery to the php page, I am also testing this on a MAMP environment not sure if this makes a difference.</p>

<pre><code>&lt;?php



$SiteName = $_POST['name'];
$_SESSION['selectedSite'] = $SiteName;
echo $_SESSION['selectedSite'];
print_r($_POST);

?&gt;
</code></pre>

<p>And the Jquery</p>

<pre><code>$(document).ready(function(){

$('.siteButton').click(function(event)
{


    var siteName = event.target.id;

    alert(siteName);
$.ajax({  
    type:   "post",  
    url: "includes/functions.php",  
    data: {'name':siteName},      
    success: function(){  
     alert("success WOOT");
    } 
  })
 }); 
});
</code></pre>
