salman_ahad@yahoo.com Posted November 18, 2009 Share Posted November 18, 2009 I have categories on top of the webpage like "Advertise", "Entrepreneur", "Shetech", "Smartphones" etc. <?php include("includes/categories.php"); ?> //The categories include file will be called by those subdomain. It shall look like this <div><ul class="categories"> <li><a href="http://advertise.ideatoceo.com/">Advertising</a></li> <li><a href="http://entrepreneur.ideatoceo.com">Entrepreneur</a></li> <li><a href="http://shetech.ideatoceo.com">She TECH </a></li> <li><a href="http://smartphones.ideatoceo.com">Smart Phones </a></li> </div> I want to keep this <div> class in some include file and call it on those subdomain pages. For example if http://advertise.ideatoceo.com/ is calling this include file...it should show to user as <div> <li><a href="http://entrepreneur.ideatoceo.com">Entrepreneur</a></li> <li><a href="http://shetech.ideatoceo.com">She TECH </a></li> <li><a href="http://smartphones.ideatoceo.com">Smart Phones </a></li> </div> // since advertise is calling it, I want to exclude advertise link here. Similarly if "Enterpreneur" is calling this include file, //need to exclude "http://entrepreneur.ideatoceo.com" Any help Quote Link to comment https://forums.phpfreaks.com/topic/181942-optimized-php-page/ Share on other sites More sharing options...
oni-kun Posted November 18, 2009 Share Posted November 18, 2009 This is impossible if I think what you're asking is that. You can either use CSS to define the div manually, without defining it as a class. Or define it as a class. There's no way to hide it from the user.. save a bit of JS obfuscation or something crazy. But your intentions aren't so clearly shown, so I've not a clue. Quote Link to comment https://forums.phpfreaks.com/topic/181942-optimized-php-page/#findComment-959694 Share on other sites More sharing options...
salman_ahad@yahoo.com Posted November 18, 2009 Author Share Posted November 18, 2009 Any way we could code this like $URL= //fetch the url customer is on if URL="http://a.mysite.com" { <div class="categories"> b.mysite.com c.mysite.com d.mysite.com </div> } ... if URL="http://b.mysite.com" { <div class="categories"> a.mysite.com c.mysite.com d.mysite.com </div> } ... if URL="http://c.mysite.com" { <div class="categories"> a.mysite.com b.mysite.com d.mysite.com </div> } ... if URL="http://d.mysite.com" { <div class="categories"> a.mysite.com b.mysite.com c.mysite.com </div> } //Something like this? Quote Link to comment https://forums.phpfreaks.com/topic/181942-optimized-php-page/#findComment-959757 Share on other sites More sharing options...
mikesta707 Posted November 18, 2009 Share Posted November 18, 2009 You could get the current url like so $url = "http://" . $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; echo $url; Example output: http://localhost/test2.php Quote Link to comment https://forums.phpfreaks.com/topic/181942-optimized-php-page/#findComment-959760 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.