How to detect if file is being accessed or requested?

AltenDemAmerb

New Member
A I have a PHP file that if the user access it directly he should be redirected to another location, but if my script call it through ajax, it should do nothing special.For example, if a user access\[code\]/site/page.php\[/code\]he should be redirected to\[code\]/index.php?view=page\[/code\]But if he is on the \[code\]index.php?view=page\[/code\] the file should load without redirects.How can I do that?
 
Back
Top