# AJAX and PHP Auto Refresh

**URL:** <https://forum.kirupa.com/t/ajax-and-php-auto-refresh/250508>\
**Category:** programming\
**Created:** [January 30, 2008, 3:01am UTC](https://forum.kirupa.com/t/ajax-and-php-auto-refresh/250508 "2008-01-30T03:01:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LooInSpain](https://avatars.discourse-cdn.com/v4/letter/l/a88e57/32.png) [@LooInSpain](https://forum.kirupa.com/u/LooInSpain)\
**Post date:** [January 30, 2008, 3:01am UTC](https://forum.kirupa.com/t/ajax-and-php-auto-refresh/250508/1 "2008-01-30T03:01:06Z")

</div>

Hi,

I am currently working on a site where I’d like a portion of the page to auto refresh every 15-20 seconds. I have a PHP page that has four includes from other pages and a query from a database. I’d like one of the includes to auto refresh as this is calling a select from a complete database table at random with a maximum of 5 results, so I’d like those results to change every 15-20 seconds without refreshing the whole page.

I looked at a meta refresh on the include page but that just refreshed the whole page when I just want the include portion to refresh. I Googled it and saw something about AJAX being able to do this. I looked at a couple of scripts but they were working with ASP and I haven’t got a clue about ASP.

Can anyone give me any pointers where I can find a tutorial about integrating this into a PHP page or help me out a little?

Thanks
