Detect whether the browser is refreshed or not using PHP

前端 未结 6 1400
慢半拍i
慢半拍i 2021-01-01 02:51

I want to detect whether the browser is refreshed or not using PHP, and if the browser is refreshed, what particular PHP code should execute.

6条回答
  •  甜味超标
    2021-01-01 03:15

     1)
        {
            echo "You hit the refresh button!";
        }
        else
        {
            echo "This is my site";
        }
    
        // To clear out the visits session var:
        // unset($_SESSION["visits"]);
    
    ?>
    

提交回复
热议问题