Jump to content

Constant Refreshing


pudge

Recommended Posts

You may or may not have read my previous post about the file_put_contents command in a shoutbox. Well, I gave up on that idea, as i believe the problem may be that I do not have the right PHP version, so i am now using the fopen(), fwrite() and fclose() commands. It is all working pretty good except that the file_get_contents() command needs to refresh about every second or so. Any ideas on how i can do that?

Link to comment
Share on other sites

You may or may not have read my previous post about the file_put_contents command in a shoutbox. Well, I gave up on that idea, as i believe the problem may be that I do not have the right PHP version, so i am now using the fopen(), fwrite() and fclose() commands. It is all working pretty good except that the file_get_contents() command needs to refresh about every second or so. Any ideas on how i can do that?
AJAX...
Link to comment
Share on other sites

AJAX...
...could you expand on that? I tried skimming through the w3 tutorial, but i could only see examples where the code was refreshed each time you typed something in. i need the single line of code to be refreshed all the time. (which is why i havent used the meta tag that reportingsjr told me about, because it refreshed the entire page over and over again, which defeated the object as it stopped you from being able to input anything in the boxes without it refreshing and getting rid of what you've typed in before you can submit. As for the header idea, i couldn't get it to work. i assume it is supposed to be inserted into php script, what with the semi-colon at the end. thanks for the ideas though)
Link to comment
Share on other sites

...could you expand on that? I tried skimming through the w3 tutorial, but i could only see examples where the code was refreshed each time you typed something in. i need the single line of code to be refreshed all the time. (which is why i havent used the meta tag that reportingsjr told me about, because it refreshed the entire page over and over again, which defeated the object as it stopped you from being able to input anything in the boxes without it refreshing and getting rid of what you've typed in before you can submit. As for the header idea, i couldn't get it to work. i assume it is supposed to be inserted into php script, what with the semi-colon at the end. thanks for the ideas though)
Try looking into the setTimeout and setInterval functions in the HTML DOM. You can use these to set up a timer on your page that executes a code block (i.e. an AJAX call) at certain intervals.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...