Hello!
I am trying to make a simple page with link buttons in a ul which display a png image next to the relevant link to show which page the viewer is looking at. Now I'm aware that there are other ways to do this, but just so I feel I've learnt something I would like to use php if possible.
I got the impression that something like this would work:
<ul>
<li class="linkbutton"><a href="index.php"><?php
if ($_SERVER['PHP_SELF'] ="index.php"){
echo '<img src="assets/flower.png" class="flower"/>';}
else {
echo '<img src="assets/placeholder.png" class="flower"/>';}
?>Home</a>
</li>
</ul>
Now while this does work to a point (the flower shows up when on the home page) it does not work in that the thing turns up in the same place on every other page too. I have tried numerous variants on this, but can't seem to get it functional.
Does anyone have any suggestions as to what I'm doing wrong? Sorry to be such a noob!
Thanks,
Hathouse