I have the store.php setup with an extra <td> in the table at the top - in this td I have an image I use as a header image.

My idea is to have this header image swap to another (same size) image whenever someone loads another page (by clicking on the menu or by another menu item) - that way each page would have its own header image on the page, not just the standard single image it now uses. Because the site is dynamic it could concievably work from the url...

The store uses a mySql database and the (crn) stands for the category record number and the (rn) stands for the item record number so the url would display like this: store.php?crn=208&rn=421 (if I were to paste this behind the url of the store; the item in that category would display on the page.

Ideally the script would determine the url based on: either the crn (category record number) or the rn (record number) or the simple page ?page=pagename.... and display the corresponding image from an array.

Now in the store.php page I've tried these php scripts (in all instances the path to the sc_images dir must be absolute!!)

These mostly kinda-sorta work, they display the image but don't "swap" - Is there anyone out there with more PHP skills than I have than could make these work - especially #3 or am I being a nut-job! Also this is NOT a randomizer! It's supposed to show a specific image for either a category, page or a product, all from using the url.... or crn and rn numbers.

this is how you would get the record number
if (is_numeric($_GET['record_number']))
------------------ TEST 1
This is what I started with:

<img src="http://www.path_to_sc_images/logorot/<?php
if (is_numeric($_GET['record_number'])) {
print '001.jpg';
} elseif ($record_number == 394) {
print '002.jpg';
} elseif ($record_number == 393) {
print '003.jpg';
} else {
print '000.jpg" />';

------------------ TEST 2

this one I tried a straightforward swap based on the record_number

if(isset($_GET['view'])) { $record_number = $_GET['view'];}
else { $image2show = "http://www.path_to_sc_images/logorot/000.jpg"; }
if($record_number == 213) { $image = "http://www.path_to_sc_images/logorot/001.jpg"; }
if($record_number == 212) { $image = "http://www.path_to_sc_images/logorot/002.jpg"; }
if($record_number == 220) { $image = "http://www.path_to_sc_images/logorot/003.jpg"; }
------------------ TEST 3
This one I changed to use the current page being displayed --- (I really prefer this type - it could then include whatever page is being viewed - not just the record)
I pretty much included all types of page links - one to a category - one to a product detail - one to the carts contents - one to a page - and one to the store (obviously the record numbers and the category numbers would have to be correct.

if(isset($_GET['view'])) { $curpage = $_GET['view'];}
else { $image2show = "http://www.path_to_sc_images/logorot/000.jpg"; }
if($curpage=="store?page=terms") { $image = "http://www.path_to_sc_images/logorot/001.jpg"; }
if($curpage=="store.php?crn=208&rn=421&action=show_detail") { $image = "http://www.path_to_sc_images/logorot/002.jpg"; }
if($curpage=="store.php?crn=208") { $image = "http://www.path_to_sc_images/logorot/003.jpg"; }
if($curpage=="store.php?show_cart=yes") { $image = "http://www.path_to_sc_images/logorot/004.jpg"; }
if($curpage=="store.php?page=contact") { $image = "http://www.path_to_sc_images/logorot/005.jpg"; }
if($curpage=="store.php") { $image = "http://www.path_to_sc_images/logorot/000.jpg"; }
------------------ TEST 4

if ($record_number == 200) {
print 'http://www.path_to_sc_images/logorot/000.jpg';
} elseif ($record_number == 211) {
print 'http://www.path_to_sc_images/logorot/000.jpg';
} elseif ($record_number == 212) {
print 'http://www.path_to_sc_images/logorot/000.jpg';