Re: server-side redirect thingy?

by "tim booker" <timbooker(at)btinternet.com>

 Date:  Mon, 12 Mar 2001 14:26:51 -0000
 To:  "Peter Schonefeld" <peter.schonefeld(at)bigpond.com>,
"Hwg-Techniques" <hwg-techniques(at)hwg.org>
 References: 
  todo: View Thread, Original
Thanks for your reply,

Of course I could use this method, I could even do this client-side using
JS.  My question is, can it be done so that you refer to a script as the src
of the image, and the script returns the correct image?

So, if I put <img src="header.pl">, it would display header.png or
header.gif, depending upon the browser.

I want something that would be nicely invisible, that would not require me
to chop up every page in a scripting language.

Tim

www.timbooker.com


----- Original Message -----
From: "Peter Schonefeld" <peter.schonefeld(at)bigpond.com>
To: "tim booker" <timbooker(at)btinternet.com>
Sent: Tuesday, March 13, 2001 8:13 AM
Subject: RE: server-side redirect thingy?


Hi Tim,

I use a browser sniffer in my ASP code and then render the appropriate HTML
for
various  browsers.

In your case the code would look something like this...
<%
browserSniff();  //calling the function that would reveal the client browser
var imageTag = (ie5)?"someimage.png":"someimage.gif";
%>

and in the html...

<img src="<% =imgageTag %>">

I don't use PHP, but i'd imagine that the implementation would be very
similar.

HTH
Peter

> -----Original Message-----
> From: owner-hwg-techniques(at)hwg.org
> [mailto:owner-hwg-techniques(at)hwg.org]On Behalf Of tim booker
> Sent: Monday, 12 March 2001 4:45 AM
> To: wdf(at)yahoogroups.com; Hwg-Techniques
> Subject: server-side redirect thingy?
>
>
> Hello All,
>
> I want to build a site using the alpha transparency of PNG graphics.
> However, we all know that this is only supported by a small percentage of
> today's web browsers.
>
> I'm wondering if there's any way to use a script which will detect the
> browser and direct it to a PNG or GIF as appropriate.
>
> Of course, I could do this client-side using JavaScript, but that could
get
> a bit messy across multiple pages and multiple graphics.
>
> I'm wondering if there's a way of doing this server-side, in PERL or
> possibly PHP.  Something like:
>
> <img src="graphic.pl">
>
> And the script would return the appropriate image.
>
> Any ideas?
>
> Thanks,
>
> Tim
>
>
>
>
>
> Tim Booker
> __________________________
>
> Saltstone Media Ltd
> http://www.saltstonemedia.co.uk/
>
>
>
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA