| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Realtime php/mysql gatherer (hmm...) I need a way to "refresh" php in realtime. either way would be: 1. When it detects a new field in a mysql table based on a mysql query it refreshes the page 2. It just loads up new information when it can I thought about using a "while" thing for this, but I couldn't think of a good way to do it. Any help would be excellent! ![]() Thanks in advance Tom |
| |
| | THREAD STARTER #3 (permalink) |
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | no. I am trying to make like a chat script for php where it will automatically update the page. Like this: 1. User writes message + submits 2. Message gets stored in DB 3. On user's friend's side the php script is constantly checking for new messages, but without messy window refreshes 4. When a new message is found, the script writes it up on the screen (or refreshes - but only when a new message is found) and vice versa! ![]() Thanks ![]() Tom |
| |
| | #4 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,074
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | that cant be done not with php anyway. php is a server side script what you need to do is use a javascript refresh or something like that to refresh the page with the chat.
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft |
| |
| | THREAD STARTER #6 (permalink) | ||||
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Is there a way I can get javascript to "send" a php function to the server, and have it return something? (i know I am probably talking dribble now! lol) so apart from refreshing the page, there is no way to do this? ![]() Is there any way to refresh the page neatly and quickly? | ||||
| |
| | #8 (permalink) | ||||
| Senior Member Join Date: May 2003
Posts: 2,187
![]() ![]() ![]() |
so you could have pagea.php inside this youd have your javascript function insdie a timer which refreshed every 30 seconds. this would call pageb.php then javascript would present the information out in a page which means you wouldnt need to refresh pagea.php | ||||
| |
| | THREAD STARTER #9 (permalink) | ||||
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks a lot! ![]() ????: NamePros.com http://www.namepros.com/showthread.php?t=79661 Tom | ||||
| |
| | #10 (permalink) |
| Senior Member Join Date: May 2003
Posts: 2,187
![]() ![]() ![]() | im not sure what to search for but here is an example http://www.aspplayground.net/forum/forumid_2/tt.htm# then click one the plus signs im guessing the bit you need is there it lodas the data then then slign than in a time function. i just had a quick root through there source and turnt this up http://www.aspplayground.net//forum/js/treeRow.js |
| |
| | THREAD STARTER #11 (permalink) | ||||
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() I think, although you are very kind, I will stick with the reloading page. Or I will figure something out which is slightly easier. What you gave me, really didn't help. Infact I almost s**t myself! ![]() Acctually thinking about it - I could have an iframe and then just reload the iframe. Or do some fancy javascript whatnot to just re-write whats in it! ![]() Thanks for all the help! Another question, to stimulate your tired braincells (aww... I don't mean it... seriouslly! ):- Is there anyway of getting info out of a mysql database with javascript? I suppose if I can, then I can just reload the content in an iframe every 5 seconds or something using "iframename.document.write" javascript function. I don't know much about javascript... that is my only problem! ![]() Thanks a lot, for all the replys I have already had, and all the ones I hope to recieve! ![]() Tom | ||||
| |
| | #12 (permalink) | ||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,074
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft | ||||
| |
| | #14 (permalink) |
| Account Suspended Join Date: May 2004 Location: /etc/passwd
Posts: 2,178
![]() ![]() ![]() ![]() ![]() ![]() | if you ever seen http://achaea.com look at the java applet, i have made a clone of this game via php/mysql/flash and it loads just as fast, if not faster. Flash is the way to make something this... |
| |
| | THREAD STARTER #15 (permalink) |
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | nice site! that looks really good, I bet yours is better though. You can do a hell of a lot more with flash. That my only problem though, is the flash. I can't do it. I probably could if I put my mind to it, but I don't know it yet.Can anyone point me in the direction of any good tutorials? Thanks Tom |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help needed with personal project. PHP/MySql programming and layouts! | QBert | Website Development | 3 | 11-09-2004 10:52 AM |
| Experienced php/mysql coder [FOR HIRE] Low prices! | matrixnet | For Sale / Advertising Board | 0 | 04-12-2004 12:09 PM |