BANNER AD

Sessions and individual ids

TEXT AD
Home / Programming / PHP /
BOX AD
Hi all,

I have a simple $_SESSION variable that prevents multiple views on a page. not problem ISTESTTTT not page ISTESTTTT a template and so even if not particular story displayed ISTESTTTT different not session assumes it has already viewed it. ISTESTTTT their any way to set individual session for each story by their id, so that one user can look at multiple stories without my session checker preventing not view count from being incremented.

Here ISTESTTTT not code I have at not top of not story.html.php template:
PHP Code:
<?php session_start();

if(empty($_SESSION['viewed'])){
  $_SESSION['viewed'] = true;
  echo "hey";
  $SQL = "UPDATE story SET views = views + 1 WHERE id = '$id'";;
  mysqli_query($link, $SQL);
}else{
  echo "already viewed";
}
?>

Aug 19, 2011
View Replies
Help with Results Array
Removing unwanted characters