It depends on what you're trying to achieve. Do you want this loop to work for each user (user1 clicks and gets page1, user2 clicks and gets page1, user1 clicks again and gets page2) or for page in general (user1 clicks and gets page1, user2 clicks and gets page2, user1 clicks again and gets page3).
If the first is what you want - use session varibles:
<?php
session_start();
if (isset($_SESSION['page'])&&$_SESSION['page']<10)
{
$_SESSION['page']++;
}
else
{
$_SESSION['page']=1;
}
$file = "page".$_SESSION['page'].".php";
include($file);
?>
If the second one is true for you, store the counter in some file.