jQuery: .get() callback accepting multiple parameters
<p>I am making a comics website... it will have two sub sites: Comics and Artwork. </p>

<p>When someone clicks on a specific sub site, a "site" parameter will be passed in (comics or artwork) which specifies from which table (comics or artwork) images should be queried.</p>

<p>That all works... except I am trying to add this extra parameter to this search function which currently only accepts the input string, but doesn't know which table to search.</p>

<p>So, I have a search function that accepts input from an input box:</p>

<pre><code>&lt;span class="search"&gt;&lt;input type="text" onkeyup="search(this.value)" name="input" value="" /&gt;&lt;/span&gt;
</code></pre>

<p>JQuery:</p>

<pre><code>function search() {     
 $.get("./scripts/search.php", {"_input" : $('input[name=input]').val()},
    function(returned_data) {
                $("#output").html(returned_data);
    }
  );
}
</code></pre>

<p>PHP search script... gets search string input</p>

<pre><code> $input = (isset($_GET['_input']) ? ($_GET['_input']) : 0); 
</code></pre>

<p>But I'd also like to pass in a "_site" parameter that specifies from which subsite on my website images should be returned from:</p>

<pre><code>function search() {     
 $.get("./scripts/search.php", {"_input" : $('input[name=input]').val(), "_site" :     $('input[name=site]'.val()},
    function(returned_data) {
                $("#output").html(returned_data);
    }
);
</code></pre>

<p>}</p>

<p>So the PHP search script would get search string, but also know which site it's on:</p>

<pre><code>$input = (isset($_GET['_input']) ? ($_GET['_input']) : 0); 
$site = (isset($_GET['_site']) ? ($_GET['_site']) : null);
</code></pre>

<p>Is it possible to send in multiple parameters through the JQuery? Is that even the right way to do it?</p>

<p>------------EDIT 
This is how the "site" search param is affecting the search query</p>

<pre><code>$site = (isset($_GET['_site']) ? ($_GET['_site']) : null);
echo "SEARCH SITE = " . $site;

if($site == "artwork") {
        $id = "artid";
        $title = "arttitle";
        $path = "artpath";
        $thumb = "artthumb";
        $catid = "artcatidFK";
        $table = "artwork";

        $thumbpath = "./images/Artwork/ArtThumbnails/";
}
else {
        $id = "imgid";
        $title = "imgtitle";
        $path = "imgpath";
        $thumb = "imgthumb";
        $catid = "imgcatidFK";
        $table = "comics";

        $thumbpath = "./images/Comics/ComicThumbnails/";
}


$imgpaths = $mysqli-&gt;query("SELECT $id, $title, $path, $thumb, $catid FROM $table");
mysqli_close($mysqli);
</code></pre>

<p>Thanks!</p>
