Monday, December 17, 2012

Catch browser refresh event- php




session_start();


if (!isset($_SESSION["visits"]))
        $_SESSION["visits"] = 0;
    $_SESSION["visits"] = $_SESSION["visits"] + 1;

    if ($_SESSION["visits"] > 1)
    {
        $insert = $_SESSION["$lastinsert"];
        echo "You hit the refresh button!";
    }
    else
    {
        $_SESSION["$lastinsert"] = $last_insert;      
        echo "This is my site";
    }

No comments:

Post a Comment