Hi I'm looking for a simple solution that will show a html / php web page for X number of views - after that it will show another page. The logic goes like this When someone clicks on the landing page url, the page code will - Read from a text file, the views count, views limit, page 1 url detail, page 2 url detail - If views count is less than or equal to the limit * Add 1 to e views count, write back to text file, then show page 1 - If views count is more than the limit * Show page 2 Help appreciated, thanks.
list($pageonecount, $maxviews, $url1, $url2) = file('stats.txt', FILE_IGNORE_NEW_LINES); if ($pageonecount <= $maxviews) { $pageonecount++; $o = fopen('stats.txt', 'w'); fwrite($o, implode("\n", array($pageonecount, $maxviews, $url1, $url2))); fclose($o); // Show page one? include $url1; } else { include $url2; } PHP: Something like that? Not sure how you wanted to 'show' the pages. Text file would be something like: 0 100 file1.html file2.html Code (markup): (separated by lines)