how to know what files called for a php file
<p>Here's what I want to do. I have 3 php files, one is a.php, b.php, and c.php.
If a.php has a link to b.php, by using an href tag or by is using b.php as its form action.
How would b.php know that it is a.php who is calling it? 
c.php is also linked to b.php. But I want to redirect the page to something else if it is not a.php who is using b.php.</p>

<p>I'm thinking of something like this for b.php,i'm just not sure how to do it in actual php code:</p>

<pre><code>&lt;?php

if(called_by('a.php')){
echo "something";
}
else{
header('location:a.php');
}

?&gt;
</code></pre>
