用户来自正确的道路

I want to make sure that the user comes though the proper path.

So if the user hits page2 or page3 without having been to index then I want to send them back to page1.

What is the best way to do this?

I'd say with the sessions.

In index, start with:

<?php
session_start();
$_SESSION['index_visited'] = 1;
?>

Then in the other pages:

<?php
session_start();
if ( !isset($_SESSION['index_visited']) )
  header('Location: index.php');
?>

or cookies:

index.php

setcookie('index_visited', 1);

other pages

if (!isset($_COOKIE['index_visited']) || $_COOKIE['index_visited'] != 1 ) {
    header('Location: index.php');
}