I am trying to come up with a way to display an image based on the value of a field in the database for each product. For example if the field's value is E, it would display the image for E. If the value was T, it would display the image for T, and so forth. Here is what I have so far code-wise:
Code:
<?php /*
if ($_GET['esrb_rating'] == "EC")
{
echo '<img src="/esrb/ec_esrb.jpg" width="122" height="88" alt="Early Childhood ESRB Rating">';
}
else {
if ($_GET['esrb_rating'] == "E")
{
echo '<img src="/esrb/e_esrb.jpg" width="122" height="88" alt="Everyone ESRB Rating">';
}
}
else {
if ($_GET['esrb_rating'] == "E10+")
{
echo '<img src="/esrb/e10_esrb.jpg" width="122" height="88" alt="Everyone 10+ ESRB Rating">';
}
}
else {
if ($_GET['esrb_rating'] == "T")
{
echo '<img src="/esrb/t_esrb.jpg" width="122" height="88" alt="Teen ESRB Rating">';
}
}
else {
if ($_GET['esrb_rating'] == "M")
{
echo '<img src="/esrb/m_esrb.jpg" width="122" height="88" alt="Mature ESRB Rating">';
}
}
else {
if ($_GET['esrb_rating'] == "AO")
{
echo '<img src="/esrb/ao_esrb.jpg" width="122" height="88" alt="Adults Only ESRB Rating">';
}
}
else {
if ($_GET['esrb_rating'] == "RP")
{
echo '<img src="/esrb/rp_esrb.jpg" width="122" height="88" alt="Rating Pending ESRB Rating">';
}
}
else {
}*/
?>
I have no idea if I even coded this correctly. I borrowed the idea from someone else, so not sure if I'm doing it correctly or not. Thanks for any help.
Bookmarks