Forum Moderators: open

Message Too Old, No Replies

How to determine IP?

Different IP, different pict files.

         

waynemac

4:04 pm on Oct 20, 2004 (gmt 0)

10+ Year Member



Greetings all, I run a forum and information website in Japan.

I am setting up a mobile site that is accessed by 3 different mobile phone companies (docomo, skyweb and ezweb).

I want to determine where the incoming visitors from so to dish up different pict files as some use png and not gif and vis-a-versa. The common pict file type is jpeg and thats too big for what Im doing.

Ive looked around but cant find what Im looking for.

AND, from there, how would I encode it to pull different file types? Is there an "if this browser then access image folder A, if not then B" script?

Im new to this so any input would be appreciated.

Thanx in advance, Wayne in Japan

crashomon

4:23 pm on Oct 20, 2004 (gmt 0)

10+ Year Member



Hi Wayne, you can use Javascript to 'sniff' out the browser and use a IF/THEN scenario to send appropriate images to the user.

One tip: Save all images with the same name (such as imagename.gif and imagename.png) and you can use javascript to append ".png" or ".gif" for the filename in order to pull up the appropriate picture file.

Example: If browser type ="A" then pull imagename +".png"
If browser type ="B" then pull imagename +".gif"

Doing so dynamically in javascript will save you the hassle of rewriting all your webpages.

You may want to ask around in the javascript forum.

Hope this helps, and good luck!

Patrick Elward

waynemac

4:46 pm on Oct 20, 2004 (gmt 0)

10+ Year Member



Patrick, thanx for the reply. That gives me a great lead. Im off to the Java Room to make a posting.

Awesome.

Wayne