datoshway Posted June 9, 2010 Share Posted June 9, 2010 Hey guys. I'm looking for a way to remove the footer of a website if the site is accessed from a different domain. Basically setting up a mirror site on a new domain and want the footer removed from it. Rather then have two working sites, i'd like to find a way to remove just the footer from the site if the domain is that new domain. Any ideas? Link to comment https://forums.phpfreaks.com/topic/204330-script-to-remove-footer-if-accessed-from-a-different-domain/ Share on other sites More sharing options...
trq Posted June 9, 2010 Share Posted June 9, 2010 You can check for the domain name using $_SERVER['SERVER_NAME'] Link to comment https://forums.phpfreaks.com/topic/204330-script-to-remove-footer-if-accessed-from-a-different-domain/#findComment-1070136 Share on other sites More sharing options...
datoshway Posted June 10, 2010 Author Share Posted June 10, 2010 Thanks! So something like this? Then just require the footer? Would that work? if (isset($_SERVER["HTTP_REFERER"])) { Link to comment https://forums.phpfreaks.com/topic/204330-script-to-remove-footer-if-accessed-from-a-different-domain/#findComment-1070147 Share on other sites More sharing options...
trq Posted June 10, 2010 Share Posted June 10, 2010 No, that would not work. Firstly, because $_SERVER['HTTP_REFERER'] should always be set, and secondly, because it has nothing to do with determining what domain your site is being accessed on. Did you read my previous reply? Link to comment https://forums.phpfreaks.com/topic/204330-script-to-remove-footer-if-accessed-from-a-different-domain/#findComment-1070151 Share on other sites More sharing options...
datoshway Posted June 10, 2010 Author Share Posted June 10, 2010 Sorry yeah I meant to paste SERVER_NAME, not HTTP_REFERER, my fault. So would just a if statement work with that snippet? Link to comment https://forums.phpfreaks.com/topic/204330-script-to-remove-footer-if-accessed-from-a-different-domain/#findComment-1070155 Share on other sites More sharing options...
mrMarcus Posted June 10, 2010 Share Posted June 10, 2010 Pseudo-code might be: <?php if ($_SERVER['SERVER_NAME'] === 'www.example.com') { // show/include footer; } Link to comment https://forums.phpfreaks.com/topic/204330-script-to-remove-footer-if-accessed-from-a-different-domain/#findComment-1070158 Share on other sites More sharing options...
datoshway Posted June 10, 2010 Author Share Posted June 10, 2010 Perfect! Thanks Mr Marcus. Link to comment https://forums.phpfreaks.com/topic/204330-script-to-remove-footer-if-accessed-from-a-different-domain/#findComment-1070164 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.