Jump to content

Refreshing an include?


Snooble

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/96725-refreshing-an-include/
Share on other sites

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).

Link to comment
https://forums.phpfreaks.com/topic/96725-refreshing-an-include/#findComment-494961
Share on other sites

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

 

Link to comment
https://forums.phpfreaks.com/topic/96725-refreshing-an-include/#findComment-494973
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/96725-refreshing-an-include/#findComment-494984
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.