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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.