Jump to content

osamaboshi

Members
  • Posts

    1
  • Joined

  • Last visited

osamaboshi's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I want to count user who open the page , I want to insert in mysql table when user open the page and I want to insert or upadet when close the page by click [x] or press alt+F4 but not onunload or onbeforeunload , cause this also call when refresh I want to call this alert when close onlyI can use a code which insert when open and not insert when refresh , but I couldnt solve insert or update when close the pagehere is my code: <?session_start();if (!isset($_SESSION["visits"])) $_SESSION["visits"] = 0;if ($_SESSION["visits"] > 0){echo 'visit='.$_SESSION["visits"];echo "You hit the refresh button!";}else{ mysql_query( "INSERT INTO najd_visit( visit_userId, visit_staticId, visit_page, visit_enterTime)VALUES ('$userId', '$Sid', '$title', '$date') "); $_SESSION["visits"] = $_SESSION["visits"] + 1;echo 'visit='.$_SESSION["visits"];echo "This is my site";}?>
×
×
  • Create New...