$cr_page = basename($_SERVER['PHP_SELF']); 
if($cr_page == 'index.php') {
// sadece index.php'de çalışacak kodunuz buraya
}