Closed Thread Icon

Preserved Topic: searching for the Holy Grail? Pages that link to <a href="https://ozoneasylum.com/backlink?for=18212" title="Pages that link to Preserved Topic: searching for the Holy Grail?" rel="nofollow" >Preserved Topic: searching for the Holy Grail?\

 
Author Thread
JKMabry
Maniac (V) Inmate

From: out of a sleepy funk
Insane since: Aug 2000

posted posted 07-21-2001 22:35

I asked this same question months ago and never really got a good answer that worked. It's come up again and thought maybe I should try again. I've been looking all over the web and it seems like I'm searching for the Holy Grail of javascript... I'm not even sure if javascript is the answer anymore.

I want to refresh 1 page, 1 time when you first open it. (It's a page that PHP writes to in order to make a 5 word daily update) I've used META tags, pragma no cache, I've used a body onload refresh command and combinations of the 2 but they just send me into eternal clickingloophell. I'm stuck on this javascript refresh command, there's gotta be a way to do it with this, simply, doesn't there? I'm not that good with scripting languages at all. the only thing I can think of to do is to make a button that the user would have to manually click to refresh the page. I'd much rather find a way to do this automatically when the page loads.

I know if it can be done, the person that can do it is among the inmates here. I've seen things...



Jason

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 07-21-2001 23:19

Here's your answer, I did this once... you know how some addresses have a little "?something=value&somethingelse=othervalue" at the end of them? Use that.

//"refresh once" code
if (location.search.indexOf("refresh") == -1)
{
location.search = "?refresh";
location.reload(true);
}

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 07-22-2001 10:40

I did something like this in order to add correct session id to the URL (and at the end I had an *extremely* complex session handling library). Anyway, in your case it is very simple, just put the following at the *top* of your PHP page:

<?php

if (!$reload) {
&nbsp;&nbsp;&nbsp;&nbsp;// <-- do your randomizing stuff here
&nbsp;&nbsp;&nbsp;&nbsp;header("Location: $PHP_SELF?reload=1");
}

?>

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 07-25-2001 03:25

JK, are you alive? How about some feedback here? Did this help?

JKMabry
Maniac (V) Inmate

From: out of a sleepy funk
Insane since: Aug 2000

posted posted 07-25-2001 03:32

alive? barely.

Sorry for not getting back, I thanked you in the looking back thread cuz I figgered this one had died.

I think it will work, I haven't had a chance to look at it yet, been really busy, but it looks good to me, not to long. I should be able to disect it at least and learn something from it. I like the short little bits I can wrap my head around =)

I'm gonna mess with that PHP as well. Many thanks to both of you. Heckuva lot better info in 2 posts than I got last time in the whole thread. Grazi!

Jason

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 07-25-2001 04:03

Ah, ok. Tell us when you get a chance to try it out. =)

« BackwardsOnwards »

Show Forum Drop Down Menu