kratsg Posted August 31, 2008 Share Posted August 31, 2008 In the code for the clock creation: <?php header ("Refresh: 1; URL=$page"); header('Content-type: image/png'); imagePNG ($im); imageDestroy ($im); ?> $page is a variable that contains the URL to refresh the clock (with correct settings). Is there ANY way to get it to refresh via PHP WITHOUT using any client-side coding such as JavaScript? It all works, except for it autorefreshing o_o Quote Link to comment https://forums.phpfreaks.com/topic/122057-solved-cant-get-an-image-generated-in-php-to-auto-refresh/ Share on other sites More sharing options...
.josh Posted August 31, 2008 Share Posted August 31, 2008 Nope. You can't get it to keep running (refreshing) w/out client constantly sending a request. You could make a cronjob to constantly execute it but that's not really relevant to your problem... edit: And on that note, I would suggest you consider putting even more of it onto the client. Like for instance, making a swf that does the same thing and just imbedding it. Quote Link to comment https://forums.phpfreaks.com/topic/122057-solved-cant-get-an-image-generated-in-php-to-auto-refresh/#findComment-630086 Share on other sites More sharing options...
dezkit Posted August 31, 2008 Share Posted August 31, 2008 i think you gotta make it a gif? Quote Link to comment https://forums.phpfreaks.com/topic/122057-solved-cant-get-an-image-generated-in-php-to-auto-refresh/#findComment-630088 Share on other sites More sharing options...
kratsg Posted August 31, 2008 Author Share Posted August 31, 2008 Yeah, I thought about flash, but it seems all to easy to resort to flash. So there is ABSOLUTELY no way to get it to re-update w/o javascript? That sucks. Quote Link to comment https://forums.phpfreaks.com/topic/122057-solved-cant-get-an-image-generated-in-php-to-auto-refresh/#findComment-630099 Share on other sites More sharing options...
.josh Posted August 31, 2008 Share Posted August 31, 2008 well you could like, do a meta tag refresh for every like, 1 second... Quote Link to comment https://forums.phpfreaks.com/topic/122057-solved-cant-get-an-image-generated-in-php-to-auto-refresh/#findComment-630101 Share on other sites More sharing options...
.josh Posted August 31, 2008 Share Posted August 31, 2008 and anyways, what's wrong with resorting to flash? Your clock would look cleaner, since it's vector based, and it puts the processing load onto the client instead of the server, and it keeps your script from constantly requesting the server... Quote Link to comment https://forums.phpfreaks.com/topic/122057-solved-cant-get-an-image-generated-in-php-to-auto-refresh/#findComment-630102 Share on other sites More sharing options...
PFMaBiSmAd Posted August 31, 2008 Share Posted August 31, 2008 If we ignore that what you are doing is probably the worst way to accomplish this - In your existing code, the refresh header would need to be on the HTML page that contains the <img src="..." alt=""> tag that lists your php generated image. Quote Link to comment https://forums.phpfreaks.com/topic/122057-solved-cant-get-an-image-generated-in-php-to-auto-refresh/#findComment-630103 Share on other sites More sharing options...
kratsg Posted August 31, 2008 Author Share Posted August 31, 2008 I guess flash might be best :-o Quote Link to comment https://forums.phpfreaks.com/topic/122057-solved-cant-get-an-image-generated-in-php-to-auto-refresh/#findComment-630113 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.