My bad for not getting back to you sooner...
I looked through all of our old tours but couldn't find the exact code we used. It's something along the lines of this though:
Code:
<?php
// use your variable here
$ID_OF_VIDEO_HERE = $_REQUEST['video'];
if(isset($_SESSION) === false)
session_start(); // Start PHP session management
if(isset($_SESSION['videos_viewed']) === false)
$_SESSION['videos_viewed'] = array();
if(isset($_SESSION['videos_viewed'][$ID_OF_VIDEO_HERE]) === FALSE AND count($_SESSION['videos_viewed']) >= 3)
{
// Redirect the User
header('location: http://SUBSCRIBE_PAGE');
exit();
}
else
{
// Add current video ID to list
$_SESSION['videos_viewed'][$ID_OF_VIDEO_HERE] = true;
}
// JUST FOR TESTING
var_dump($_SESSION['videos_viewed']);
?>