Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > code to check browser verison and alter url accordingly

Reply
Thread Tools

code to check browser verison and alter url accordingly

 
 
TheDragon
Guest
Posts: n/a
 
      12-11-2004
I wish I could master this, When users brows my site, I would like them to
get a browser optimised version, specific to their setup.

I.e., a regular IE/Netscape users on a desktop/laptop gets the regular site.
A user browsing from a pockepPC/Palm get a pocket optimised version
a user browsing from a mobile phone, gets a wml version.

Like this
www.mysite.com - regular users
www.mysite.com/pocket pocketpc users
www.mysite/wap for mobile users..

I know Google does this, because when I go their from my PPC, I get a small
version, and the url is www.google.co.uk/palm/
Tried to look at the code of the Google site, but there is nothing there to
see of any relevance.


Thanks in advance.


 
Reply With Quote
 
 
 
 
paul
Guest
Posts: n/a
 
      12-11-2004
TheDragon wrote:

> I wish I could master this, When users brows my site, I would like them to
> get a browser optimised version, specific to their setup.
>
> I.e., a regular IE/Netscape users on a desktop/laptop gets the regular site.
> A user browsing from a pockepPC/Palm get a pocket optimised version
> a user browsing from a mobile phone, gets a wml version.
>
> Like this
> www.mysite.com - regular users
> www.mysite.com/pocket pocketpc users
> www.mysite/wap for mobile users..
>
> I know Google does this, because when I go their from my PPC, I get a small
> version, and the url is www.google.co.uk/palm/
> Tried to look at the code of the Google site, but there is nothing there to
> see of any relevance.
>
>
> Thanks in advance.



It's fairly easy if you have PHP support, there probably are other ways.
http://www.edgehill.net/1/index.php?...ser-detect.php

<?php
if (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE") !== false) {
?>
<center><b>You are using Internet Explorer, IDIOT!</b></center>
<?php } else { ?>
<center><b>You are not using Internet Explorer so you must be
smart!!</b><br>
(you are using:
<?php echo $_SERVER["HTTP_USER_AGENT"];?>
)</center>
<?php } ?>

 
Reply With Quote
 
 
 
 
Jan Faerber
Guest
Posts: n/a
 
      12-11-2004
TheDragon wrote:

> I wish I could master this, When users brows my site, I would like them to
> get a browser optimised version, specific to their setup.
>
> I.e., a regular IE/Netscape users on a desktop/laptop gets the regular
> site. A user browsing from a pockepPC/Palm get a pocket optimised version
> a user browsing from a mobile phone, gets a wml version.
>
> Like this
> www.mysite.com - regular users
> www.mysite.com/pocket pocketpc users
> www.mysite/wap for mobile users..
>
> I know Google does this, because when I go their from my PPC, I get a
> small version, and the url is www.google.co.uk/palm/
> Tried to look at the code of the Google site, but there is nothing there
> to see of any relevance.
>
>
> Thanks in advance.


..ogoO0ogl.
http://www.webhostingtalk.com/archiv.../350071-1.html
http://www.240px.com/howto.htm
http://www.palmone.com/us/software/w...loperGuide.pdf

For a deeper answer click here:

http://imgsrc.hubblesite.org/hu/db/1...s/low_mpeg.mpg

(;



--
Jan

http://linux.janfaerber.com
 
Reply With Quote
 
Kris
Guest
Posts: n/a
 
      12-11-2004
In article <>,
"TheDragon" <> wrote:

> I wish I could master this, When users brows my site, I would like them to
> get a browser optimised version, specific to their setup.


Author for the web, not for specific browsers and your problem goes away.

--
Kris
<> (nl)
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      12-11-2004
Jan Faerber wrote:

> TheDragon wrote:
>
>> I wish I could master this, When users brows my site, I would
>> like them to get a browser optimised version, specific to their
>> setup.


Is this really necessary any longer?

>> I.e., a regular IE/Netscape users on a desktop/laptop gets the
>> regular site. A user browsing from a pockepPC/Palm get a pocket
>> optimised version a user browsing from a mobile phone, gets a wml
>> version.

<snip>

> .ogoO0ogl.
> http://www.webhostingtalk.com/archiv.../350071-1.html


Says use JavaScript. What do you do if it is disabled or unavailable?

> http://www.240px.com/howto.htm


Says: "The following basic Java code will work to seamlessly screen
and redirect PocketPC users ..." Java code? <lol>

> http://www.palmone.com/us/software/w...loperGuide.pdf


Didn't read this .pdf.

My opinion is that any correctly-designed site will work on all
devices without resorting to sniffing shenanigans. Check your site in
Opera, and choose "View > Small Screen" to test. My sites all work
perfectly in that mode, with no trickery. A friend with a PDA confirms.

--
-bts
-This space intentionally left blank.
 
Reply With Quote
 
Jan Faerber
Guest
Posts: n/a
 
      12-11-2004
Beauregard T. Shagnasty wrote:


>> http://www.palmone.com/us/software/w...loperGuide.pdf

>
> Didn't read this .pdf.


It says:
'PalmTM Web Pro 3.0 Developer Guide | Contents | Detecting Palm Web Pro
access .... page 5'

<q>
Because handhelds typically have smaller screen sizes and other physical
characteristics that make them differnet from desktop computers, you may
want to optimize pages specifically for handhelds viewing. Your web server
can detect Palm Web Pro access requests by looking for the browser's
user-agent string. A simple server-side script can detect the access and
display pages that work with the handheld's configuration.

The user-agent string for Palm Web Pro 3.0 is:

Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0, <manufacturer ID>-<model ID>)

where <manufacturer ID> and <model ID> are replaced with the appropriate ID
codes.

Tungsten(R)T3 example:

Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0; Palm-Arzl)

Tungsten C example:

Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0; palm-MT64)

The presence of the manufacturer ID and model ID in the user-agent string
allows you to optionally send different content to different Palm handheld
models. For information about model IDs for the various Palm handheld
models, please visit the Palm developer support web site at
pluggedin.palmone.com.

If you have different version of the Web Pro browser such as v3.0.1b, the
appropriate version number will be present in the user-agent string.
</q>




--
Jan

http://linux.janfaerber.com
 
Reply With Quote
 
nice.guy.nige
Guest
Posts: n/a
 
      12-11-2004
While the city slept, TheDragon () feverishly typed...

> I wish I could master this, When users brows my site, I would like
> them to get a browser optimised version, specific to their setup.


http://www.anybrowser.org/campaign/

Cheers,
Nige

--
Nigel Moss
http://www.nigenet.org.uk
Mail address not valid. , take the DOG. out!
In the land of the blind, the one-eyed man is very, very busy!


 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      12-11-2004
Jan Faerber wrote:
> Beauregard T. Shagnasty wrote:
>
>>> http://www.palmone.com/us/software/w...loperGuide.pdf

>>
>> Didn't read this .pdf.

>
> It says: ...
>
> ... Your web server can detect Palm Web Pro access
> requests by looking for the browser's user-agent string.


...which is unreliable. Easily forged in any number of browsers. <g>
What page will it serve me if my UA says "I love palm trees but my
browser is Snagglethorpe 3.0" ?

I still say the easiest way is to write pages that work in all
browsers rather than trying to sniff. Seems a pain to have to maintain
three or four different sites, wouldn't y'all agree?

--
-bts
-This space intentionally left blank.
 
Reply With Quote
 
Jan Faerber
Guest
Posts: n/a
 
      12-11-2004
Beauregard T. Shagnasty wrote:

> Jan Faerber wrote:
>> Beauregard T. Shagnasty wrote:
>>
>>>> http://www.palmone.com/us/software/w...loperGuide.pdf
>>>
>>> Didn't read this .pdf.

>>
>> It says: ...
>>
>> ... Your web server can detect Palm Web Pro access
>> requests by looking for the browser's user-agent string.

>
> ..which is unreliable. Easily forged in any number of browsers. <g>
> What page will it serve me if my UA says "I love palm trees but my
> browser is Snagglethorpe 3.0" ?
>
> I still say the easiest way is to write pages that work in all
> browsers rather than trying to sniff. Seems a pain to have to maintain
> three or four different sites, wouldn't y'all agree?
>


So the palm automatically redirects to www.google.com/palm - ?




--
Jan

http://linux.janfaerber.com
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      12-11-2004
Jan Faerber wrote:

> So the palm automatically redirects to www.google.com/palm - ?


Perhaps. I don't have one. Google probably has ample coders to
maintain multiple versions of their sites, but this isn't something
the average small shop should need to be involved in.

Did you notice the "About" link on that page takes you right to their
main site? <g> (in my browser)

--
-bts
-This space intentionally left blank.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to append a file accordingly? Why Tea Perl Misc 10 11-27-2007 11:14 AM
In a GridView how do you search for an item and set the GridView1.PageIndex accordingly? S_K ASP .Net 1 10-18-2007 06:06 PM
Alter the HTML output before it's sent to the web browser, possible? Brian Simmons ASP .Net 2 07-19-2007 08:43 PM
Alter - Perl extension for Alter Ego Objects anno4000@radom.zrz.tu-berlin.de Perl Misc 0 06-30-2007 04:13 PM
Trial to Full Verison =?Utf-8?B?dmlkZW9tYW4=?= Windows 64bit 6 07-06-2005 11:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57