Jump to content

Optimized php page


salman_ahad@yahoo.com

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/181942-optimized-php-page/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/181942-optimized-php-page/#findComment-959694
Share on other sites

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? 

 

 

Link to comment
https://forums.phpfreaks.com/topic/181942-optimized-php-page/#findComment-959757
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.