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 8637117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:23:51+00:00 2026-06-12T10:23:51+00:00

I have index.php like main page and I have sidebar.php included in index.php. In

  • 0

I have index.php like main page and I have sidebar.php included in index.php. In index.php I have div id=content with some content already loaded.. and in sidebar.php a I have

<form id="search" method="post" action="" >
      <input type="search" name="search" id="search"> 
      <input type="submit" name="search" id="search" class="btnButton" value="Search"/>
</form> 

so how can I display my search result in div id=content when I click on submit?

  • 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-12T10:23:53+00:00Added an answer on June 12, 2026 at 10:23 am

    Call the search.php from main page using Jquery ajax. make sure u reference the jQuery library.

    //Main Page
    <form id="search" method="post" action="" >
          <input type="text" name="search" id="search"> 
          <input type="submit" name="search1" id="search1" class="btnButton" value="Search"/>
    </form> 
    
    <div id="content"></div>
    
    <script>
    $(document).ready(function(){
    
        //jquery click event
        $("#search").live("click", function(e){
    
           //disable default form submit postpage
           e.preventDefault();
    
           //make ajax call to the search.php parsing the search textbox value as query string
           $.get("search.php?s="+$("#search").val(), function(result){
    
                //Result will be dumped in the div
                $("#content").html(result);
    
           });
    
       });
    
    });
    
    </script>
    
    
    
    //Search PHP Script search.php
    <?php
    
    //Get the search String
    $string = $_GET["s"];
    
    //DO search query and echo it on this page.
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main page, index.php and I would like to redirect all URI
I built a classified. In the main/index.php page, I have many categories like cars,
Usually I have the main page (index.php) that include header/footer/menu and the content of
I have parent page index.php and inside it i have iframe like below <div
I have a function that I use on index.php page and I would like
I have this page: http://www.thedome.it/cmsms/index.php?page=alla-spina I'd like to send a newsletter to subscribers every
I have a classifieds website. In the main page (index) I have several form
So I have this index.php page: <?php include main.php; ?> <html> <head> <link rel=stylesheet
Let's say i have an index.php that has html in it that looks like
I have a folder structure like this: /articles .index.php .second.php .third.php .fourth.php If I'm

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.