ocpaul20 Posted July 5, 2008 Share Posted July 5, 2008 OK, well here's the background: What I am trying to do is to determine if a visitor has been to my website before, irrespective of IP address. I dont want to use cookies because some people dont allow them. They may not have logged in to my website either(in the case of robots etc). So what I am thinking is if I can gather a load of available information about them and then make a checksum of it all. Then I can store that number in a file somewhere and check against it next time they arrive. It wont be perfect, I know, but it will probably be better than going on IP address or cookie. The most information I can find is provided by the Javascript Browser sniffer at http://www.webreference.com/tools/browser/javascript.html but the problem with this is that it is clientside and I dont think there is any way to get the information back to the server for me to store. Is there anyway, using ajax or any other method to get theis type of information back server-side? I wonder what percentage of people or robots use cookies because that is the only way I suspect might work - to read a cookie in PHP in the next page request that was written by the javascript in the previous page. Quote Link to comment Share on other sites More sharing options...
ratcateme Posted July 5, 2008 Share Posted July 5, 2008 i cant help with making a checksum but once you make one i would recommend storing it in a database rather than a file that way you can look through it much easier Scott. Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted July 5, 2008 Share Posted July 5, 2008 cookies could remain on teh client... but then they have control. the most you would be able to do is a) set a cookie or b) ask them to login to be able to access your site.. which is imparactical in many cases. If you set a cookie, then set it with a very long random sequence of numbers - ensure its unique to a database, and ten store the value in a database of flat file. each time a page is viewed - check to see if that unique value is in the cookie or stored on your server.. and if it isnt then set it. Thats the only way. gdlk Quote Link to comment Share on other sites More sharing options...
ocpaul20 Posted July 5, 2008 Author Share Posted July 5, 2008 but... how do I get the information back to the server for me (the php program that comes along next) to read it? Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted July 5, 2008 Share Posted July 5, 2008 yeah. on the page - when they visit you nex.. you simply have an included file at the top the page - that checks for the user data etc. theres a range of things you can do this by - but thats the most common method. gdlk Quote Link to comment Share on other sites More sharing options...
ocpaul20 Posted July 5, 2008 Author Share Posted July 5, 2008 PC nerd: Am I missing something but I thought that by the time the page was served to the client, the PHP program had no control over it and could not get any variables back from the client? As I understand it, PHP is a server-only language and is used to generate the html which is then served to the browser. 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.