Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How I can now which Browser the Client is using?

Status
Not open for further replies.

jjmew

Programmer
Aug 20, 2002
34
US
I am designing a website in Cold Fusion and I need to be able to detect which browser the client is using, How I can do that? please help me

JJ
 
there is a cgi variable called HTTP_USER_AGENT. if you have an if statement like this:

<CFIF HTTP_USER_AGENT CONTAINS &quot;IE&quot;>
version is IE
<CFELSEIF ... and so on for the browsers that you want to detect

</CFIF>

hope this helps !
 
How I can now if the Browser is Netscape 5 or newer version?
 
I am using some html tag that dont work in Netscape 4. Almost all my clients are using Internet Explorer but I just want to validate the Index webpage.

I have found the way to do it and is like this

<CFIF HTTP_USER_AGENT CONTAINS &quot;/5.&quot; or HTTP_USER_AGENT CONTAINS &quot;/6.&quot; or HTTP_USER_AGENT CONTAINS &quot;/7.&quot; or HTTP_USER_AGENT CONTAINS &quot;/8.&quot; or HTTP_USER_AGENT CONTAINS &quot;/9.&quot; or HTTP_USER_AGENT CONTAINS &quot;IE&quot;>

<cfelse>

</cfif>

Thanks for you help guys
 
I was intrigued because I have been going back and forth with a Mac client who is unbale to get some online forms to post thus allowing a cfinsert tag. I had another Mac user test the files and it would not work in IE but did in Netscape. However, my client is still not able to post the form. Is there any way around this? Does this have to do with open standards? The client can get other forms on the same page to work but these particular ones do not.

Thank you
 
Misereatur

What you can do is in your page find out what browser the are using. If they are using IE in MAC the code to identify that will be something like that

<CFIF HTTP_USER_AGENT CONTAINS &quot;IE&quot; or HTTP_USER_AGENT CONTAINS &quot;MAC&quot;>

<cfelse>

</cfif>

Once that u know what kind of browser they are using u can use the right tag supported by MAC. If u have another question feel free to ask,

Juan JOSE
 
This is all unpleasant to me. I did not know I needed a correct tag for Mac. How do I find out what it should be? Right now I just have a <cfupdate> (oops, I said insert before).

Thank you
 
I havent work with MAC so I dont know, but if take a look to the book probably u can find de equivalent for update, but know that u r able to know which browser they are using it will be easier
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top