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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.