Set cookie on one page...
setcookie ('cookie', 'test');
Only load page if they have the cookie code
if ($cookie == "test") {include "connect.inc";}
else {echo "Sorry, you do not have permission to enter this page"; exit;}
Ie - the page fails to load unless the cookie is present, this has to be changed slighly if not a database page of course.