我怎么知道页面真的是在浏览器中打开的,还是从脚本或 src="xxx" 中获取的?
<?php
session_start();
if(!isset($_SESSION['count'])){
$_SESSION['count']=0;
}
// I don't want to
// if(open in brower){
$_SESSION['count']++;
// }
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$.ajax({
url:'index.php',
type:'GET',
data:{},
success:function(){}
});
</script>
<?php
echo $_SESSION['count'] ; // the result now is 1,3,5,... for every reload
// I want to get the result 1,2,3,4... for every reload , how to check the page is really open in brower? not run in ajax or get ?
?>