Gazing into my crystal ball I observed "GU" <ge************@yahoo.de>
writing in news:11**********************@i40g2000cwc.googlegr oups.com:
Is it possible to use an simple cgi script to select one graphic
dynamically and use this one as background image?
if using
<body background="/httpdocs/pics/test.jpg"> blah </body>
i'll get this backgroung picture.
but i want to get the backgroungimage dynamically. so i'd like to use
an simple cgi script
<body background="/cgi-bin/test.pl"> blah </body>
but this does not work.
the script is like this:
#!/usr/bin/sh
file="/httpdocs/pics/test.jpg"
cat $file
Of course i may use perl/GD or jpgraph to do this, but i want to know
if there is a way to do this with a script.
thanks
gerhard
I would use CSS instead, you can programatically create CSS as long as
you serve the right content type. Then you can link to that external
stylesheet, eg: <link type="text/css" rel="stylesheet"
href="dynamicstyle.asp">
Maybe dynamicstyle looks something like:
<% option explicit
Response.ContentType = "text/css" %>
<% dim backgroundimage, backgroundcolor, bodycolor
if datepart("m",date()) = 12 and datepart("d",date()) = 25 then
backgroundimage = "evergreen.gif"
backgroundcolor = "#228b22"
bodycolor = "#fff"
elseif datepart("m",date()) = 2 and datepart("d",date()) = 14 then
backgroundimage = "hearts.gif"
backgroundcolor = "#ff0"
bodycolor = "#fff"
else
backgroundimage = "regular.gif"
backgroundcolor = "#fff"
bodycolor = "#000"
end if
%>
body {color:<%=bodycolor%>;
background-color:<%=backgroundcolor%>;
background-image:<%=backgroundimage%>}
}
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share