Thread: Refresh Screen

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    Montreal, Canada
    Posts
    72
    Rep Power
    15
    I have a page like a my.yahoo where people can log into the page and add and remove modules from the page. However, I use javascript to refresh the page each time a user logs in, adds module, removes modules or edits the modules. However some browsers do not automatically refresh the page and my users get confused and feel that their page was not modified. If they however press REFRESH or hit the F5 button, they notice the customized changes.

    I included this piece of code in the HEAD part of my page but it did not work.
    <meta http-equiv="http://www.mysite.com/home/index.php" content="no-cache">

    Is there some other piece of PHP code I can add to ensure that the page is refreshed each time it is requested for whether by javascript or manually.

    Thanks in advance, I will really be grateful as this problem is slowing down my development.

    ------------------
    Visit my PHP V-Portal.
    <a href="http://www.igboryders.com"><b>http://www.igboryders.com</b></a>
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    7
    Rep Power
    0
    hey ....
    there is a lot of info on this on the forum and in other places but this worked for me.....

    simply add a ? at the end of the URL..
    seems silly but it works

    <meta http-equiv="http://www.mysite.com/home/index.php?" content="no-cache">

    hope that helps
    ccbcreg


    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Uchechi:
    I have a page like a my.yahoo where people can log into the page and add and remove modules from the page. However, I use javascript to refresh the page each time a user logs in, adds module, removes modules or edits the modules. However some browsers do not automatically refresh the page and my users get confused and feel that their page was not modified. If they however press REFRESH or hit the F5 button, they notice the customized changes.

    I included this piece of code in the HEAD part of my page but it did not work.
    <meta http-equiv="http://www.mysite.com/home/index.php" content="no-cache">

    Is there some other piece of PHP code I can add to ensure that the page is refreshed each time it is requested for whether by javascript or manually.

    Thanks in advance, I will really be grateful as this problem is slowing down my development.
    [/quote]

  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    Montreal, Canada
    Posts
    72
    Rep Power
    15
    Tried this but still to no avail.

    ------------------
    Visit my PHP V-Portal.
    http://www.igboryders.com
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    7
    Rep Power
    0
    cool site....
    way cool site.... i like it i like it..
    go here and take a look...
    may help http://www.phpbuilder.com/tips/item.php?id=123


    Sometimes browsers just wont reload that page (only reinstalling the browser seems to work :-) In this case this "hack" works nicely:

    $kludge=md5(uniqid(rand()));

    then just add $kludge in all urls:

    <a href="nocachepage.php?kludge=$kludge">

    or in forms use hidden fields..


    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Uchechi:
    Tried this but still to no avail.

    [/quote]

  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    Montreal, Canada
    Posts
    72
    Rep Power
    15
    The question mark behind the URL is actually a good hack of a kind. The browser assumes that mypage.php and mypage.php? are not the same page and will hence not cache the page. I have already used that for the log-in process.

    The random number generator is quite cool. I was previously thinking of having some off and on kind of switch to either add a ? or remove the ? at the end of the URL depending on what was present before. I will look into the 2 options and settle for whichever is less complicated.

    Thanks for the compliments about the site. I just started with PHP and it is absoulutely wonderful. I knew some C and Java and I merely applying the logic to generate HTML.

    ------------------
    Visit my PHP V-Portal.
    http://www.igboryders.com

IMN logo majestic logo threadwatch logo seochat tools logo