rootKID Posted December 23, 2012 Share Posted December 23, 2012 (edited) yoyo W3 again...i have a question, even when its a stupid one. does anyone knows how to deny acces to a website made with a speciel browser?... like if i where to only wish google chrome users to see my site (as a examble)... is that possible?... -thanks in advance... Edited December 23, 2012 by rootKID Link to comment Share on other sites More sharing options...
Ingolme Posted December 23, 2012 Share Posted December 23, 2012 Why would you want to do that? Not everybody has or wants Chrome. Link to comment Share on other sites More sharing options...
rootKID Posted December 23, 2012 Author Share Posted December 23, 2012 true... and i dont wish to... just a question ... the only thing i know of is about .htacces... but what my question was about was if there was a method made in .PHP?... (maybe me not being more detailed, still working on that part in me ..) Link to comment Share on other sites More sharing options...
Ingolme Posted December 23, 2012 Share Posted December 23, 2012 Look at the $_SERVER['HTTP_USER_AGENT'] and try to figure out which one Chrome uses. The change all the time and the user has control over what is sent or whether it is sent. Link to comment Share on other sites More sharing options...
Colourtheory Posted December 23, 2012 Share Posted December 23, 2012 You might want to block a browser that's not supported by your product. Link to comment Share on other sites More sharing options...
Ingolme Posted December 23, 2012 Share Posted December 23, 2012 If there's a feature that a browser doesn't have, test for that particular feature rather than for the browser. Link to comment Share on other sites More sharing options...
thescientist Posted December 25, 2012 Share Posted December 25, 2012 yeah, i can't imagine anyone blocking an entire browser market from their website. It's really not that hard to support all browsers, even IE6/7. Link to comment Share on other sites More sharing options...
rootKID Posted December 27, 2012 Author Share Posted December 27, 2012 sorry for a little bit delay dudes, and yeah, i will see into it... but wont use it... more a question so i know's how to do in case of some of my clients wish to do so... example, i had a flower shop last week, and he wished that Opera not could get into he's website... and i did not knew how to do it...so im simply reading up upon it... Link to comment Share on other sites More sharing options...
jardrake Posted December 27, 2012 Share Posted December 27, 2012 Just a quick note $_SERVER['HTTP_USER_AGENT'] is going to give you a nasty little string like Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11 so you will need to employ some regex and tinker with all of the browsers to see exactly what each browser sends as the agent string. Personally, I think it is a terrible idea no matter what reason you provide. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now