Retrieve info sent to php file with jquery .get
<p>I have this function that send data to a php file, but for some reason, it seems like the php file isn't getting the data that jquery sent to it.</p>

<p>Here is the jquery code:</p>

<pre><code>&lt;script type="text/javascript" src="JS/jquery-1.3.2.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    $(document).ready(function(){
        $(".hide").hide();
        $("#cake").hide();

        var boz = $('#cake').val();
        var search = $('#search').val();

    $.get("petition_send.php", { id: boz, q: search }, function(data){
        alert("Data Loaded: " + data);
     });

    $('.show').click(function checkPass(){
        $(".hide").slideDown();
    });

    });
&lt;/script&gt;
</code></pre>

<p>Now, here is the php file:</p>

<pre><code>&lt;?php
$xmlDoc = new DOMDocument();

include_once("petitionhint.php");

$xmlDoc-&gt;loadXML($xmlout);

$x=$xmlDoc-&gt;getElementsByTagName('friend');

//Get the q parameter from URL
$q      =   $_GET["q"];
$id     =   $_GET["petition_ID"];

//Lookup all links from the xml file if length of q&gt;0
if(strlen($q)&gt;0)
{
    $hint = "";

    for($i=0; $i&lt;($x-&gt;length); $i++)
    {
        $y=$x-&gt;item($i)-&gt;getElementsByTagName('name');
        $z=$x-&gt;item($i)-&gt;getElementsByTagName('url');
        $w=$x-&gt;item($i)-&gt;getElementsByTagName('photo');
        $l=$x-&gt;item($i)-&gt;getElementsByTagName('location');

        if ($y-&gt;item(0)-&gt;nodeType==1)
        {
            //Find a link matching the search text
            if (stristr($y-&gt;item(0)-&gt;childNodes-&gt;item(0)-&gt;nodeValue,$q))
            {
                if($hint != ""){
                        $hint .= "&lt;br /&gt;";
                   }
                    $hint .= "&lt;h1 id='poli'&gt;&lt;a id='blue' href='";
                    $hint .= $z-&gt;item(0)-&gt;childNodes-&gt;item(0)-&gt;nodeValue;
                    $hint .= "&amp;amp;petition_ID='$id' &gt;";
                    $hint .= $y-&gt;item(0)-&gt;childNodes-&gt;item(0)-&gt;nodeValue;
                    $hint .= "&lt;/a&gt; &lt;br /&gt;&lt;a id='green'&gt;";
                    $hint .= $l-&gt;item(0)-&gt;childNodes-&gt;item(0)-&gt;nodeValue;
                    $hint .= "&lt;/a&gt;";
                    $hint .= "&lt;br/&gt;&lt;img width='30' height='30' id='schmidt' src='features/";
                    $hint .= $w-&gt;item(0)-&gt;childNodes-&gt;item(0)-&gt;nodeValue;
                    $hint .= "' /&gt;&lt;/h1&gt;";
            }
        }
    }
}

// Set output to "no suggestion" if no hint were found
// or to the correct values
if($hint == "")
{
    $response = "No suggestions";
} else
{
    $response   =   $hint;
}

//output the response
echo $response;
?&gt;
</code></pre>

<p>When I try in include the "$id" variable into the part of the php code here:</p>

<pre><code>$hint .= "&amp;amp;petition_ID=$id' &gt;";
</code></pre>

<p>it doesn't appear. the $id variable doesn't appear.</p>
