I created a PHP site that has 3 pages, i.e., A, B, and C. Both A and B will call page C first by using "require_once". Is there a way for page C to know if this call came from A or B?
$_SERVER['HTTP_REFERER']
didn't work.
I created a PHP site that has 3 pages, i.e., A, B, and C. Both A and B will call page C first by using "require_once". Is there a way for page C to know if this call came from A or B?
$_SERVER['HTTP_REFERER']
didn't work.
A.php
$page = 'A';
require_once 'C.php';
B.php
$page = 'B';
require_once 'C.php';
C.php
echo 'I was required by'.$page;