Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:54:06+00:00 2026-06-14T02:54:06+00:00

I am making a comics website… it will have two sub sites: Comics and

  • 0

I am making a comics website… it will have two sub sites: Comics and Artwork.

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.

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.

So, I have a search function that accepts input from an input box:

<span class="search"><input type="text" onkeyup="search(this.value)" name="input" value="" /></span>

JQuery:

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

PHP search script… gets search string input

 $input = (isset($_GET['_input']) ? ($_GET['_input']) : 0); 

But I’d also like to pass in a “_site” parameter that specifies from which subsite on my website images should be returned from:

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

}

So the PHP search script would get search string, but also know which site it’s on:

$input = (isset($_GET['_input']) ? ($_GET['_input']) : 0); 
$site = (isset($_GET['_site']) ? ($_GET['_site']) : null);

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

————EDIT
This is how the “site” search param is affecting the search query

$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->query("SELECT $id, $title, $path, $thumb, $catid FROM $table");
mysqli_close($mysqli);

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:54:08+00:00Added an answer on June 14, 2026 at 2:54 am

    Yes, this is possible. You are doing it just right in your 2nd example, expect that you forgot one ) in your code $('input[name=site]')

    function search() {     
     $.get("./scripts/search.php", {"_input" : $('input[name=input]').val(), "_site" :     $('input[name=site]').val()},
        function(returned_data) {
                    $("#output").html(returned_data);
        }
    );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

making a multi-language site with codeginiter. I have created two folders. One for french
Making a simple program which will generate a multiple choice form. I have an
Making a mobile friendly site, I have a single field and a submit button.
Making a specific example: You have a list of every first name in the
Making a new site but something is happening to it in IE8. The social
Making a word document of our network set-up. We have about 7 servers and
Making a new site but something is happening to it in IE. I've purchased
Making a form that will accept a bunch of textual data and an image
Making my way through the GAE documents. I have a question I can't find
Making a left hand side menu for my website. Should I create a Unordered

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.