Gazing into my crystal ball I observed "GU" <ge************ @yahoo.de>
writing in news:11******** **************@ i40g2000cwc.goo glegroups.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="dynamicst yle.asp">
Maybe dynamicstyle looks something like:
<% option explicit
Response.Conten tType = "text/css" %>
<% dim backgroundimage , backgroundcolor , bodycolor
if datepart("m",da te()) = 12 and datepart("d",da te()) = 25 then
backgroundimage = "evergreen. gif"
backgroundcolor = "#228b22"
bodycolor = "#fff"
elseif datepart("m",da te()) = 2 and datepart("d",da te()) = 14 then
backgroundimage = "hearts.gif "
backgroundcolor = "#ff0"
bodycolor = "#fff"
else
backgroundimage = "regular.gi f"
backgroundcolor = "#fff"
bodycolor = "#000"
end if
%>
body {color:<%=bodyc olor%>;
background-color:<%=backgr oundcolor%>;
background-image:<%=backgr oundimage%>}
}
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share