Mac vs. Windows....MAC Posted May 26, 2006 Report Share Posted May 26, 2006 How would I add a hidden field that collects the form user's browser and operating system to my form? Quote Link to comment Share on other sites More sharing options...
-pops- Posted May 26, 2006 Report Share Posted May 26, 2006 I can only think of nefarious reasons for wanting to do this. Please disabuse me of this notion.Or have I completely misunderstood what you are trying to do? Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted May 27, 2006 Report Share Posted May 27, 2006 I can think of many legitimate reasons for collecting environmental information from visitors. I don't have the resources here to find out how to do it, but I know it is possible. Quote Link to comment Share on other sites More sharing options...
PeterB Posted May 30, 2006 Report Share Posted May 30, 2006 Building visitor statistics is a very common activity among webmasters, so nothing new under the sun here...Most of them do this through analysis of the webserver logs however. This puts minimal requirements on the browser, and happens transparently while the visitor browses the website. Sometimes however you don't have access to the serverlogs, for example when you are using a low-cost webhost. In these cases it may be a good solution to aquire this information through forms.The key technology you need is JavaScript. You need JavaScript to automatically fill a hidden form field, with information from the JavaScript object "navigator.userAgent".Note however two important things:- The useragent is often "spoofed", that is the browser disguises itself as another browser, either to fool statistics or to make badly programmed websites (see next point) behave properly.- The useragent is not the right place to search when you need to know the capabilities of a browser. Badly programmed websites may look at the useragent to determine if a browser for example supports a certain JavaScript function. This will break when the user uses an unknown browser, an unexpected newer version, or has disabled certain features of his browser. You will need "object detection" if you need to know your visitor's capabilities. Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted May 30, 2006 Report Share Posted May 30, 2006 Thanks for the input! And welcome to the forum, by the way :) Quote Link to comment Share on other sites More sharing options...
PeterB Posted May 30, 2006 Report Share Posted May 30, 2006 You're very welcome :-)I just saw a forum on my expertise, with few messages in it, so I thought let's help out a bit... Quote Link to comment Share on other sites More sharing options...
Belatucadrus Posted May 30, 2006 Report Share Posted May 30, 2006 Funnel Web isn't quite what you want, but may be of interest. Quote Link to comment Share on other sites More sharing options...
Mac vs. Windows....MAC Posted June 17, 2006 Author Report Share Posted June 17, 2006 thanks i actually used one of dreamweaver's functions to view the remote statistics (before i had frontpage :0 )one more thingis there a javascript function to determine a user's IP address when they submit a form? Quote Link to comment Share on other sites More sharing options...
Blacklight Posted June 19, 2006 Report Share Posted June 19, 2006 I recently attempted to use an older version of dreamweaver, itts just as easy to learn HTML coding :SThe other day my mate showed me a Mac based website builder, I was kinda jelous to be honest.What exactly did you need itfor anyway? You never specified that... Quote Link to comment Share on other sites More sharing options...
PeterB Posted June 29, 2006 Report Share Posted June 29, 2006 is there a javascript function to determine a user's IP address when they submit a form?Not in pure JavaScript. But you can use a combination of JavaScript and SSI. SSI is an old server-side "programming" language (older than ASP for example) which is supported by most webservers. The fact that it is server-side means you are not dependend on compatibility with different kinds of webbrowsers, if it works on your webserver then it will work with any webbrowser viewing your website.Following is an example code to display the visitor's IP address:alert("IP address: <!--#echo var="REMOTE_ADDR"-->"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.