is there a way to show images with an if statement based on page?

Say you want to display a certain image based on what page the user is on, but your code comes from a .php file. Can you do like

if address is home, display main.jpg
if address is sotre, display store.jpg

and so on so you can get a graphic at the top that tells the user where they are?

I didn’t explain that well. Ok, say there’s a menu like this:

Main Store Contact

And those are pics. If the user is on the main page you want the Main image to be colored. If they are on the store page you want the store image to be colored. The way you are checking to load the normal or selected image is with an if statement.

How does one do that?

That’s a silly way to go about it. You should determine the active page, and then for each menu item, test if it’s active. If it is, set a class name of ‘active’ on it, and then style for that class.

but if you’re gonna insist on being gay about it…

<?php
// blah blah blah determine $active here
// I'm just using simple URI parsing, but maybe you need something different.
$active = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
?>
<?php if ($active === 'home') : ?>
  <!-- blah blah blah main.bmp here -->
<?php elseif ($active === 'sotre') : ?>
  <!-- blah blah blah store.tiff here -->
<?php elseif ($active === 'contact') : ?>
  <!-- blah blah blah contact(2).JPEG here -->
<?php endif; ?>

… I’m not entirely sure what that has to do with a menu, but it’s what you asked for ("if address is home, display main.jpg", etc). You can turn it into a series of if/else statements if you want. You could also use foreach(['home','sotre','contact'] as $item) etc. and test $active === $item, but that would require a way to determine the image name based on the item value. Either way, this should be a good enough starting point so you can finish it.

I really hope people don’t pay you for this stuff. Otherwise you’re making us all look bad because these are incredibly basic questions you always have.

I’m not just saying that to be a dick. I mean that. So many people have horror stories from dealing with developers who don’t know what they’re doing.

If he’s doing it as a hobby or for free, then no biggie. You get what you pay for. But if he’s charging, then it makes everyone look bad, especially if he’s charging the same as what knowledgeable developers would charge.