Get URL of Subpage that Grabs info from Master page
basically I have a bunch of sites that I have setup to include a master file thats being hosted on my main company website. On the master file I have my code setup to ech开发者_JS百科o a list of links which it grabs based on the first letter of the domain where this page is being loaded into.
Here is the code from the master file:
<?php
$url = parse_url($_GET['url']);
$str = $url['host'];
echo $str; ?>
<?php if ($str < "g") :?>
<ul id="resources">
<li>Universal</li>
<li>Superman</li>
</ul>
<?php else: ?>
<ul id="resources">
<li>Looney Toons</li>
<li>Daffy Duck</li>
</ul>
<?php endif; ?>
The code that is used the other sites just uses an include to grab this page. What I would like it to do is get the URL of the page that it includes this info into and not the URL of the website where this is hosted. Thanks
You can use debug_backtrace();
to see the file which is executing. No other possible ways that I know of.
精彩评论