Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Php refresh part of page


  • Please log in to reply
5 replies to this topic

#1 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:04:27 AM

Posted 29 May 2009 - 09:15 PM

Hi, i have this page http://202.45.110.174/social i have it so messages are stored in the database.

i want to have php check the number of rows when the page is loaded, then display the rows in descending order, wait 10 seconds, check to see if the number of rows has changed (if there are new messages) then have it either display a pop-up with javascript or refresh the <ul id="wall"></ul> bit...


is this even possible?

i got the code for the page from here

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:27 AM

Posted 30 May 2009 - 08:33 AM

Yes, it is possible. You need to store the number of messages within the user's session. If the number of threads change, then the server needs to push out the updated page.

#3 KamakaZ

KamakaZ
  • Topic Starter

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:04:27 AM

Posted 30 May 2009 - 08:40 AM

how would i accomplish this?

i have been looking into javascript and AJAX combined with php. still is very very tricky and would love any help you could give!

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:27 AM

Posted 30 May 2009 - 11:52 AM

What I would recommend is looking at web pages that auto-update and figure out what they are doing. It is not something that anyone can sit down and tell you how to do in 3 minutes. Besides, this sort of functionality should not be part of the core features anyway. This should be considered an enhancement. Get the basic stuff working first.

#5 SteelSlasher

SteelSlasher

  • Members
  • 20 posts
  • OFFLINE
  •  
  • Local time:12:27 PM

Posted 08 June 2009 - 12:10 PM

just to help you anyway even though groovicus is right about it being an enhancement, to do it you could use an iframe with a page which loads the messages and in that page just put in a piece of javascript to refresh the page every 10 secs

#6 JJ2K

JJ2K

  • Members
  • 162 posts
  • OFFLINE
  •  
  • Local time:12:27 PM

Posted 18 June 2009 - 12:46 PM

You could try looking at how Shoutboxes are created as it seems your using the same sort of functionality..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users