PHP Script To Reload Any Website In The Bottom Frame

Discussion in 'PHP' started by largn81, May 4, 2010.

  1. #1
    Hi my project is taking some time, i need some help with a PHP script that has the following characteristics:

    • the scripts reloads any web page after the number of seconds set in the has elapsed
    • the script must show a window which has 2 areas (or 2 html frames) a thin one at the top which contains a label and a text box for any URL and one "GO" button to display the website in the big frame below
    • id like to set it to 240 seconds
    • thus every 240 seconds this php page will reload the bottom frame

    i googled and found this code but it does not reload any website only the website (PHP script) itself.



    
    
    $page = $_SERVER['PHP_SELF'];
    
    $sec = "240";
    
    header("Refresh: $sec; url=$page");
    
    echo "Watch the page reload itself!";
    
    
    PHP:
    :confused:
     
    Last edited: May 4, 2010
    largn81, May 4, 2010 IP
  2. Grit.

    Grit. Well-Known Member

    Messages:
    1,424
    Likes Received:
    22
    Best Answers:
    1
    Trophy Points:
    110
    #2
    Take a look at Javascript, and use the javascript to reference the link to reload in the target frame. It could be an easier solution for you.
     
    Grit., May 4, 2010 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #3
    if the frame or the page content will be a static or independent just use javascript. if it is not, use ajax for dynamic content.
     
    bartolay13, May 4, 2010 IP
  4. largn81

    largn81 Peon

    Messages:
    237
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks grit and bartolay13 i'm still working on it i think using Scrollable DIVs is simpler what do you think?

    <DIV id="topframe">
    ... topframe stuff here ...
    </DIV>

    <DIV id="pagecontent">
    ... the page content here ...
    </DIV>
     
    largn81, May 5, 2010 IP
  5. largn81

    largn81 Peon

    Messages:
    237
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Bump
    any suggestions?
     
    largn81, May 6, 2010 IP
  6. largn81

    largn81 Peon

    Messages:
    237
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Bump
    Hi all,
    i found out it's better easier to use Javascript... howeVER the sript should be a PHP page because the POST method is required for the script to run.
     
    Last edited: May 13, 2010
    largn81, May 13, 2010 IP
  7. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #7
    Using JS is far more easier
    But if JS is disabled in browser it won't work
     
    roopajyothi, May 13, 2010 IP