Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional load of body image

Status
Not open for further replies.

rogerte

Programmer
Nov 9, 2001
164
0
0
GB
New to all this web page stuff, so please be patient with me

We need to show a different body background based on the date. That is for most of the year the body background is a plain colour, but, twice a year we need to show JPG images showing reminder messages. (ie for month of May we need to show one image, and for December another.

I understand we can use HTML, Javascript, ASP or PHP (even though I am just starting on a learning curve with all of these.)

However, as stated above I am new to all this so could anyone give me an idea of where to start?

Many thanks
 
You should pick which method you are going to use (i.e. client-side or server-side). Which ever method you choose, you can ask in the relevant forum as the implementation will be different for each language.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Sorry, but I didn't want to put the same question in each forum. As stated I am new to all this (I am used to "old-fashioned" programming languages like Cliper and Delphi), so was hoping that someone might point me in the right direction to start with.
 
I understand that you don't want to cross post, but it isn't really a HTML issue. Personally, I would do this server-side rather than client-side, so that would leave the ASP or PHP forum. Which one of those you choose is probably dependant on which language you prefer, and if the site already uses one of them.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
I personally would use PHP, but again, it depends on whether your web host supports this.

Basically all you would need to do is something akin to the following in PHP:

Code:
[red]<?PHP
if($date("m")=="5"){
$background="path\to\may\background.jpg";
}
if($date("m")=="12"){
$background="path\to\dec\background.jpg";
}
else{
$background="path\to\default\background.jpg";
}
?>[/red]
[blue]<style>
body{
background:URL([/blue][red]<? echo $background; ?>[/red][blue]);
}
</style>[/blue]

The Red parts are PHP, the blue parts are just CSS top define the background.

Again this is done with PHP, if your web host supports it.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks folks,

I gather the server can support both ASP and PHP, so will try both.

Next step to go out and purchase IDIOTS GUIDEs!

 
Nope, depending on how its set up it may only support one or the other or neither, which is why you need to find out.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top