Snooble Posted March 18, 2008 Share Posted March 18, 2008 Hey everyone... i have a page i want to keep up to date.... its "include 'login.php';" ed into my index... it needs to refresh every 3 seconds. if i use meta refresh it refreshed everything. if i use javascript (window location) it refreshes everything... ?? do i have to use a frame? Thanks Sam Quote Link to comment https://forums.phpfreaks.com/topic/96725-refreshing-an-include/ Share on other sites More sharing options...
lemmin Posted March 18, 2008 Share Posted March 18, 2008 Yep. the page the user looks at is one complete thing. If you need to refresh code, it can't be in the same location. You can use an iframe or you could probably run it in the background with a COM object (or I think there is a special character to runa process in the background, but I'm not sure that would work for what you are trying to do). Quote Link to comment https://forums.phpfreaks.com/topic/96725-refreshing-an-include/#findComment-494961 Share on other sites More sharing options...
Snooble Posted March 18, 2008 Author Share Posted March 18, 2008 the reason for the question is because... at the end of the battle i need the stats to refresh straight away... but because the info was taken at the top of the page the updated stats aren't shown by the time the updates have been made...eg STATS READ HERE 5 strength 10 defence BATTLE TIME you won + 2 strength + 1 defence I stats at the top are old... i want them to change immeadiately... any help? thanks again lemmin Sam Quote Link to comment https://forums.phpfreaks.com/topic/96725-refreshing-an-include/#findComment-494973 Share on other sites More sharing options...
Rohan Shenoy Posted March 18, 2008 Share Posted March 18, 2008 AJAX can do exactly what you need. Quote Link to comment https://forums.phpfreaks.com/topic/96725-refreshing-an-include/#findComment-494977 Share on other sites More sharing options...
lemmin Posted March 18, 2008 Share Posted March 18, 2008 Do you mean that you want to refresh the code until something changes and if it changes, refresh the content on the page that is being viewed? If so, you can put the php code in an iframe and check some conditions and when you know that page needs to be refreshed, just echo javascript like this: <script language="Javascript"> top.location="something.php"; </script> If that isn't what you are talking about, uhm, what are you talking about? Quote Link to comment https://forums.phpfreaks.com/topic/96725-refreshing-an-include/#findComment-494984 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.