Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Random Header images contribution.


Recommended Posts

HI.. I just installed the random header contribution. the problem I'm having is that I can get the alt tags to work with it.


here is what it says..


- catalog/includes/header.php


Find this line---> (around line 57)


    <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td>


Replace with this line --->


    <td valign="middle"><?php include "random_image.php"; ?></td>


and here is the code in random_image.php





// Change this to the total number of images in the folder

$total = "2";


// Change to the type of files to use eg. .jpg or .gif

$file_type = ".jpg";


// Location of the folder containing the images should have been completed in step 3 of readme.txt

$image_folder = "./images/random/";


// You do not need to edit below this line


$start = "1";


$random = mt_rand($start, $total);


$image_name = $random . $file_type;


echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";




can some help me out in getting the alt tag to show when the mose goes over the header image... right now it the alt tags shows the name od the image.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...