# Can i change a table cell background depending on the page with php?

**URL:** <https://forum.kirupa.com/t/can-i-change-a-table-cell-background-depending-on-the-page-with-php/236862>\
**Category:** Uncategorized\
**Created:** [August 24, 2007, 11:06am UTC](https://forum.kirupa.com/t/can-i-change-a-table-cell-background-depending-on-the-page-with-php/236862 "2007-08-24T11:06:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spindrift](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@spindrift](https://forum.kirupa.com/u/spindrift)\
**Post date:** [August 24, 2007, 11:06am UTC](https://forum.kirupa.com/t/can-i-change-a-table-cell-background-depending-on-the-page-with-php/236862/1 "2007-08-24T11:06:53Z")

</div>

hi guys,

the main layout of my websites is in a file called main.php. the main layout is constructed of a table and one of the cells has a background image which i would like to change to a specific image depending on which page is loaded.

at the moment my links look like: main.php?pagename=home and main.php?pagename=contact

i would like the cell in home.php to have a different background to contact.php.

ive tried using a couple of things i already know but to no avail!

could someone give me some advice on what code i should add and where to main.php and what would the page links now read.

thank you very much for any help given.

all the best,

mark
