Desperately hoping someone could help with this. I am new to php. I try to train myself with textbooks myself, and I searched high and low, but to no avail.
Basically I am looking to implement the page "If index.php, show foo , if not on index.php, show bar "
Any ideas?
I hope I explain it quite well ...
index.php includes a sidebar:
require_once('./cache/templates/sidebar.php');
Each subsequent page is built using what is defined in this index.php file, which means sidebar.php is required.
I want to modify sidebar.php to contain an ad that displays exclusively on the index page.
Currently, when I edit sidebar.php, for example, to display the letter "B", it will be displayed on the main page and on every other page, for example:
Index page: http://img.photobucket.com/albums/v684/nilsatis/1stack.jpg
Each other page: http://img.photobucket.com/albums/v684/nilsatis/2stack.jpg
How can I specify one area of ββthe included file to display on one page, but exclude showing on others?
Any help would be greatly appreciated.
[Edit] This is a website: www.grandoldteam.com. You can see where I have the text "Test" - this was introduced in sidebar.php. I would like this text (future advertising) to be displayed only on the index page, nowhere else.
[Edit 2] This is the point at which sidebar.php is called in index.php;
<p class="page_desc">'.$PAGE['subtitle'].'</p> ' ); } if (isset($url[1])) require_once('./cache/html/'.$url[0].'/'.$url[1].'.php'); else require_once('./cache/html/'.$url[0].'.php'); } } require_once('./cache/templates/sidebar.php'); } require_once('./cache/templates/footer.php');
And this is one, but in which I can edit sidebar.php to display the desired text;
<div class="clear"></div> test </div> <p> </div>