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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:15:50+00:00 2026-06-10T07:15:50+00:00

I have this page that lists info from my mysql database. It requires an

  • 0

I have this page that lists info from my mysql database. It requires an ID I $get from the url from the current page I’m on: localhost/index.php?page=id

I wanted to add a search function so that the content dynamicly changes, as you type.
Its functional but the ID that I require does not get passed when using the search function, only on the first include.

My code looks like this (I omitted some irrelevant code and html):

<?php
    $id = $_REQUEST['page']; 
?>

<script type="text/javascript">


$(document).ready(function() {


$("#faq_search_input").keyup(function()
{
var faq_search_input = $(this).val();
var dataString = 'keyword='+ faq_search_input;
if(faq_search_input.length>1)

{
$.ajax({
type: "GET",
url: "listing.php",
data: dataString,
beforeSend:  function() {


},
success: function(server_response)
{

$('#results').html(server_response).show();
$('span#faq_category_title').html(faq_search_input);

}
});
}return false;
});
});

</script>
...
...

    <form method="get" action="">
        <input  name="query" type="text" id="faq_search_input" />
    </form>
...
...
<td colspan="8">
        <ul id="sortable">
        <?php  require_once('listing.php');?>
        </ul>
</td>
...
...

Actually I think I’m loading the listing.php file twice now, as I see it. One time with the require_once and one time with my JavaScript. Can I improve this as well somehow?

So my question is: How can I get the ID to work with my javascript and could I restructer the code so I only load the listing.php once?

Please let me know if I am unclear, Im having a hard time explaining this.

Thanks a lot for any help

  • 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-10T07:15:52+00:00Added an answer on June 10, 2026 at 7:15 am

    you should change dataString to

    var dataString = 'keyword='+ faq_search_input +'&page=<?php echo $id; ?>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code_behind that get some info from an folder and then show
I have this code that fetches some text from a page using BeautifulSoup soup=
I have this function in jQuery that gets data from a page with POST,
I've created a page that lists information in a table, this information comes from
On this page there is a list of footer links that have a little
So I have this page that has some basic custom tabs: http://demo.unlockedmanagement.com/users/view/2 * NOTE
Please have a look at this demo page that I cooked up a while
I have a page that looks like this: Head and body tags... <form runat=server>
I have a page that is setup like this public partial class _Default :
I have this line below that shows a link to go the next page

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.