PHP code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vipinsaini
Forum Newbie
Posts: 5
Joined: Thu Nov 07, 2013 5:33 am

PHP code

Post by vipinsaini »

Hello.......

Actually i want to update a div of my webpage after a few seconds so can someone help me please??

Thanks in advance!!!
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP code

Post by Celauran »

PHP can't do that. Set a JavaScript timer to run on load and fire the change when the timer runs out.
vipinsaini
Forum Newbie
Posts: 5
Joined: Thu Nov 07, 2013 5:33 am

Re: PHP code

Post by vipinsaini »

Celauran wrote:PHP can't do that. Set a JavaScript timer to run on load and fire the change when the timer runs out.
Can you please show it into code blocks please because i am not expert yet..
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: PHP code

Post by Christopher »

Please post the code you have tried.
(#10850)
vipinsaini
Forum Newbie
Posts: 5
Joined: Thu Nov 07, 2013 5:33 am

Re: PHP code

Post by vipinsaini »

Christopher wrote:Please post the code you have tried.
Actually I want to update after every few seconds this div...

Code: Select all

<div class="leftside">
      <h3>Wall</h3>
	<?php include ('homewall.php');?>
 </div>
So in order to update this div i used this code.....

Code: Select all

<script src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<script>
var auto_refresh = setInterval(
function()
{
$('#leftside').load('index.php');
}, 800);
$(document).ready(function(){
$('#leftside').load('homewall.php')
})
</script>
But unfortunately, this piece of code is not working.......... So i need help to fix this piece of code.
Please fix this code...

So is it the right code or do i have to change into this piece of code??? Moreover, how i will come to know that div is being updated??
Post Reply