Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    control REFRESH?

    Is this possible...

    IF(USER HITS REFRESH){
    SEND TO THIS PAGE
    }ELSE{
    DONT
    }

    If this is possible, please let me know what really to use :P

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts
    If i only knew the javascript command to refresh, like when you hit a link it refreshes.. thats pretty simple i think... can someone tell me that?

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Not in php and doubt you could in javascript. If you could in javascript, then it'll be easy to get around anyways, so there's no point

  • #4
    Regular Coder ralph l mayo's Avatar
    Join Date
    Nov 2005
    Posts
    951
    Thanks
    1
    Thanked 31 Times in 29 Posts
    Seems to work in firefox:

    PHP Code:
    <span onclick="window.location.href = window.location.href">refresh</span

  • #5
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    or you can usually use window.reload();

    But IMO, a better choice if you want a good coverage and want to see if the user pressed refresh in their browser would be to use a PHP session to log if they have visited the page. This should work in 99.9% of cases:

    This needs to be at the very top of your script

    PHP Code:
    <?php

    session_start
    ();

    if( isset( 
    $_SESSION['page-viewed'] ) && $_SESSION['page-viewed'] == true )
    {
       
    header'Location: http://www.yoursite.com/newurl' );
       die;
    }

    $_SESSION['page-viewed'] = true;

    ?>
    <!DOCTYPE...>
    <html>
    <head>
     <title>Your Page</title>
    </head>
    <body>
     <p>What you want the user to see the first time they visit the page</p>
    </body>
    </html>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •