I have example1.php
and example2.php
that include example3.php
. In example3.php
I have:
<link rel="canonical" href="http://website.com/<?php echo basename(__FILE__); ?>">
What I wanted is to have example1.php
/example2.php
in href
dependent on the file including example3.php
. The problem is that of course __FILE__
outputs example3.php
. Is it possible to get the filename of the including file, not the included one?
Please don't suggesting using the XSS vulnerable SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']
.