-3

Possible Duplicate:
Loading Content using Ajax with PHP Include

So, I have a bit of a problem. I have a page, and in the page is a div, and in the div is an include for php. It includes a page that actually populates the div with content. Now, my issue is I want to make it so the div will refresh with more content loaded up from a MySQL server. My problem is going from the anchor link in the page, and using a (what, probably ajax I think?) call to a php function to load more content from the database. Thanks to any help anyone can give!

3
  • You could do ajax request to your php function then when there is response, you append the response on your element where you want to add it Commented Oct 29, 2012 at 6:06
  • Your description and title do not match at all. Have a look at jquery load Commented Oct 29, 2012 at 6:18
  • Sorry about the mismatched title. I guess I should rephrase...I'm trying to implement paging results from a database in php...when I press the next button, I want javascript to return my session variable + 1 to php Commented Oct 29, 2012 at 7:12

1 Answer 1

0

render a javascript snippet which will do a ajax post on click of that anchor. in that php, replace the div's innerHTML with the content you loaded from Mysql.

                `jQuery(div_id).html(content)`

will replace the div's html with content.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.