Xtremer360 Posted January 10, 2010 Share Posted January 10, 2010 I want the rollover on the title to show the champion's picture from backstage/images/champion folder and if there is no image for the title then put default.jpg from backstage/images/titles. Not sure how this is implemented. onmouseover="this.src = '?'" onmouseout="this.src = 'backstage/images/titles/".$img[$i].".jpg'" function showtitleholders10(){ $img = array('world', 'hc', 'tag'); $titlename = array('World Heavyweight Title', 'King of Carnage Hardcore Title', 'Tag Team Titles'); for($i = 0; $i < count($img); $i++){ $title = $titlename[$i]; $query = "SELECT title.shortname AS shortname, bio.charactername AS charactername FROM `efed_list_titles` AS title INNER JOIN `efed_bio` AS bio ON bio.id = title.champ_id WHERE title.name = '$title'"; if(!$result = mysql_query ($query)){ echo mysql_error() . "<br /><br />" . $query . "<br /><br />"; } $row = mysql_fetch_assoc($result); $fieldarray=array('shortname','charactername'); foreach ($fieldarray as $fieldlabel){ if (isset($row[$fieldlabel])){ $$fieldlabel=$row[$fieldlabel]; $$fieldlabel=cleanquerydata($$fieldlabel); } } print "<p><a href='backstage/content.php?p=titlehistory&title=".$shortname."'><img src='backstage/images/titles/".$img[$i].".jpg' style='width: 145px; border: 1px solid black;' alt=''/></a><strong>".$charactername."</strong></p>"; } } Link to comment https://forums.phpfreaks.com/topic/187976-mouseovers/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.