PHP help- How do I get a certain image to display when on home page of website?

LAL

New member
Do this through your FTP Client and the files in your directory. Meaning you have to upload it to the directory.

So it would be set up like this:

$home = "home";
$whiteHome = "Pics/image.jpg";
$highlight = "Pics/image2.jpg";

if ($home = 'home') {
$image = "<img src='$whiteHome' alt='Image' />";
}

else {
$image = "<img src='$highlight' alt='Image' />" ;
}
 
Do this through your FTP Client and the files in your directory. Meaning you have to upload it to the directory.

So it would be set up like this:

$home = "home";
$whiteHome = "Pics/image.jpg";
$highlight = "Pics/image2.jpg";

if ($home = 'home') {
$image = "<img src='$whiteHome' alt='Image' />";
}

else {
$image = "<img src='$highlight' alt='Image' />" ;
}
 
Do this through your FTP Client and the files in your directory. Meaning you have to upload it to the directory.

So it would be set up like this:

$home = "home";
$whiteHome = "Pics/image.jpg";
$highlight = "Pics/image2.jpg";

if ($home = 'home') {
$image = "<img src='$whiteHome' alt='Image' />";
}

else {
$image = "<img src='$highlight' alt='Image' />" ;
}
 
Do this through your FTP Client and the files in your directory. Meaning you have to upload it to the directory.

So it would be set up like this:

$home = "home";
$whiteHome = "Pics/image.jpg";
$highlight = "Pics/image2.jpg";

if ($home = 'home') {
$image = "<img src='$whiteHome' alt='Image' />";
}

else {
$image = "<img src='$highlight' alt='Image' />" ;
}
 
I want the the home button to display $highlight when on the home page, but display as $whiteHome when not on home page.

PHP Code that isn't working
########################################################

<?php
$home = 'home';
$whiteHome = 'http://www.website.com/images/navigation/home1.png';
$highlight = 'http://www.website.com/images/navigation/home1.png';

if ($home = 'home') {
$buttonURL = $highlight;
}

else {
$buttonURL = $whiteHome ;
}
?>


HTML CODE
######################################################

<img src="<? $buttonURL; ?>">
 
Back
Top