Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Question about adding a border....


Totally Lost

Recommended Posts

Hi,

Can someone let me know what I need to do to add a border to the images in the following code? (there is a different image for everyday of the week)

 

I also want to add a hyperlink, how might i do that?

 

Thanks in Advance...

 

[/code]

 

<script>

<!--

var mondayimg="http://www.xxxxxx.com/greenksilks.gif"

var tuesdayimg="http://www.xxxxxx.com/Redksilks.gif"

var wednesdayimg="http://www.xxxxxx.com/navybluegoldksilks.gif"

var thursdayimg="http://www.xxxxxx.com/_borders/ksilks.gif"

var fridayimg="http://www.xxxxxx.com/navyblueksilks.gif"

var saturdayimg="http://www.xxxxxx.com/babyblueksilks.gif"

var sundayimg="http://www.xxxxxx.com/skyblueksilks.gif"

var mydate=new Date()

var today=mydate.getDay()

if (today==1)

document.write('<img src="'+mondayimg+'">')

else if (today==2)

document.write('<img src="'+tuesdayimg+'">')

else if (today==3)

document.write('<img src="'+wednesdayimg+'">')

else if (today==4)

document.write('<img src="'+thursdayimg+'">')

else if (today==5)

document.write('<img src="'+fridayimg+'">')

else if (today==6)

document.write('<img src="'+saturdayimg+'">')

else

document.write('<img src="'+sundayimg+'">')

//-->

</script>




			
		
Link to comment
Share on other sites

<?php
$today = getdate();
echo '<a href="' . tep_href_link(FILENAME_WHATEVER) . '"><img border="1" src="http://www.xxxxxx.com/' . $today['wday'] . '.gif"></a>';
?>

 

Rename each day's .gif file to a number 0 (for Sunday) through 6 (for Saturday). Thus, navyblueksilks.gif (fridays image) would be renamed to 5.gif

 

This does not rely on javascript..

 

Hope this helps - bear in mind that this is untested. I wrote the code off the top of my head, so caveat emptor.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...