samoi Posted February 7, 2009 Share Posted February 7, 2009 hello guys, I have no knowledge of java script to make a refresh counter ! and I play Travian Game, and an idea came to my mind. The idea: instead of making a java script and set it as a counter. I did this <?php /** * @author * @copyright 2009 */ $time = date("g:i:s a"); echo "<META http-equiv=\"refresh\" content=\"1;URL={$_SERVER['PHP_SELF']}\">"; echo $time; ?> I tried it and it works just fine but I think this will cause an over load of the server or something like that, and also I think this won't work for anything else within this page. what I mean is, if a user would enter values into a form, this refreshing process will make him very angry right? because it won't let him even enter it unless the user do so in less than a sec! 'I didn't try it, but it's very clear that would happen'. so, what do you think guys? Link to comment https://forums.phpfreaks.com/topic/144183-share-me-your-opinion-on-self-refreshing-the-page-as-php-use/ Share on other sites More sharing options...
trq Posted February 7, 2009 Share Posted February 7, 2009 What exactly are you trying to do? Link to comment https://forums.phpfreaks.com/topic/144183-share-me-your-opinion-on-self-refreshing-the-page-as-php-use/#findComment-756612 Share on other sites More sharing options...
samoi Posted February 7, 2009 Author Share Posted February 7, 2009 What exactly are you trying to do? what I'm trying to do is the following as I explained above: I don't code in javascript and my knowledge is very weak in Javascript ! so, I made this instead to make a live timer ! within this code the page will be updated to the last second ! right? but what are the sequences of using this on the server ? and the user action ! Link to comment https://forums.phpfreaks.com/topic/144183-share-me-your-opinion-on-self-refreshing-the-page-as-php-use/#findComment-756615 Share on other sites More sharing options...
uniflare Posted February 7, 2009 Share Posted February 7, 2009 PHP is not meant for "real-time" processing, it is called a Hypertext "PreProcessor" for a reason. You dont have to know how to write javascript, to be able to use an already written time function. --- With our method you would need to use aax to stop the page from updating completely. But its pointless it would give completely superfluous connections. Google it "javascript Real Time Clock", most of them is just a .js file you include with a meta tag, after that you put a tiny piece of avascript on your page where ou want the clock to be. Most of the time you can customize the clocks appearence. Link to comment https://forums.phpfreaks.com/topic/144183-share-me-your-opinion-on-self-refreshing-the-page-as-php-use/#findComment-756624 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.