pudge Posted October 8, 2006 Share Posted October 8, 2006 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 More sharing options...
jhecht Posted October 9, 2006 Share Posted October 9, 2006 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 More sharing options...
reportingsjr Posted October 9, 2006 Share Posted October 9, 2006 or a header ... header("location: shoutbox.php");OR a meta tag lol<meta http-equiv="refresh" content="1;shoutbox.php" /> Link to comment Share on other sites More sharing options...
pudge Posted October 9, 2006 Author Share Posted October 9, 2006 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 More sharing options...
jesh Posted October 9, 2006 Share Posted October 9, 2006 ...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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now