Refresh an included php-file?

Discussion in 'PHP' started by fernades, Sep 2, 2010.

  1. #1
    Hi. I'm trying to refresh a php-file that is included in the other one, but I am not able to do so. Here's what I want to do (simple version):

    File 1:
    <html>
    <head>

    </head>
    <body>
    <div>

    </div>
    </body>
    </html>

    File 2:
    So, what I want to do, is to shuffle the variable every 10 seconds, thus making a new, and different, entry from the array to be echoed out in file 1.
     
    fernades, Sep 2, 2010 IP
  2. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #2
    I don't think that's possible. When you include a php file(s), it runs it as if it's one file
     
    Rainulf, Sep 4, 2010 IP
  3. TheWiseGuy

    TheWiseGuy Member

    Messages:
    113
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #3
    you can do your shuffling at page generation time and set a timed redirect ( php header(location: xxx ) or html meta redirect ) that actually regenerates the page and append the randomly picked next variable as get parameter
     
    TheWiseGuy, Sep 4, 2010 IP
  4. HuggyEssex

    HuggyEssex Member

    Messages:
    297
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    45
    #4
    Javascript would be the best option here.
     
    HuggyEssex, Sep 4, 2010 IP