Computer Help and Spyware Removal Computer Help and Spyware Removal Computer Help and Spyware Removal Computer Help Forums Windows Startup Programs Database Virus, Spyware, and Malware Removal Guides Computer Tutorials Uninstall Database File Database Computer Glossary Computer Resources
 

Welcome Guest ( Log In | Click here to Register a free account now! )



Register a free account to unlock additional features at BleepingComputer.com
Welcome to Bleeping Computer, 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.

 
Reply to this topicStart new topic
> Php refresh part of page
KamakaZ
post May 29 2009, 09:15 PM
Post #1


Senior Member
****

Group: HJT Sophomore Classmen
Posts: 440
Joined: 26-August 08
From: Victoria
Member No.: 233,642



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


--------------------
If I am helping you and don't reply in 24 hours please send me a PM

Currently in training...

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.
Go to the top of the page
 
+Quote Post
groovicus
post May 30 2009, 08:33 AM
Post #2


Hail Groovicus!
******

Group: Site Admin
Posts: 7,961
Joined: 5-June 04
From: Centerville, SD
Member No.: 689



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.


--------------------
Never Argue With Stupid People



Microsoft Senior Student Partner
Go to the top of the page
 
+Quote Post
KamakaZ
post May 30 2009, 08:40 AM
Post #3


Senior Member
****

Group: HJT Sophomore Classmen
Posts: 440
Joined: 26-August 08
From: Victoria
Member No.: 233,642



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!


--------------------
If I am helping you and don't reply in 24 hours please send me a PM

Currently in training...

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.
Go to the top of the page
 
+Quote Post
groovicus
post May 30 2009, 11:52 AM
Post #4


Hail Groovicus!
******

Group: Site Admin
Posts: 7,961
Joined: 5-June 04
From: Centerville, SD
Member No.: 689



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.


--------------------
Never Argue With Stupid People



Microsoft Senior Student Partner
Go to the top of the page
 
+Quote Post
SteelSlasher
post Jun 8 2009, 12:10 PM
Post #5


Member
**

Group: Members
Posts: 20
Joined: 2-January 09
Member No.: 277,127



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
Go to the top of the page
 
+Quote Post
JJ2K
post Jun 18 2009, 12:46 PM
Post #6


Member
**

Group: Members
Posts: 134
Joined: 23-January 09
Member No.: 286,225



You could try looking at how Shoutboxes are created as it seems your using the same sort of functionality..
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 21st November 2009 - 08:35 PM


Advertise   |   About Us   |   Terms of Use   |   Privacy Policy   |   Contact Us   |   Site Map   |   Chat   |   Tutorials   |   Uninstall List
Discussion Forums   |   The Computer Glossary   |   Resources   |   RSS Feeds   |   Startups   |   The File Database   |   Virus Removal Guides

© 2003-2009 All Rights Reserved Bleeping Computer LLC.