phppaper Posted June 22, 2008 Share Posted June 22, 2008 Dear All, I have some php code and I want it only to run in firefox. how to write the if condition for it?? thanks Quote Link to comment https://forums.phpfreaks.com/topic/111320-codes-only-run-in-firefox-how-to-do-so/ Share on other sites More sharing options...
rarebit Posted June 22, 2008 Share Posted June 22, 2008 php runs on the server not clients browser... can you show your problem and any errors it's giving you? Quote Link to comment https://forums.phpfreaks.com/topic/111320-codes-only-run-in-firefox-how-to-do-so/#findComment-571461 Share on other sites More sharing options...
phppaper Posted June 22, 2008 Author Share Posted June 22, 2008 My website's google adsense "image adv" sometimes crashes when I use firefox. Quote Link to comment https://forums.phpfreaks.com/topic/111320-codes-only-run-in-firefox-how-to-do-so/#findComment-571462 Share on other sites More sharing options...
Darklink Posted June 22, 2008 Share Posted June 22, 2008 It shouldn't do. Anyway, you can check the users browser by doing some expression checking on the users agent. You can then determine what to do from there on in. Quote Link to comment https://forums.phpfreaks.com/topic/111320-codes-only-run-in-firefox-how-to-do-so/#findComment-571478 Share on other sites More sharing options...
maexus Posted June 22, 2008 Share Posted June 22, 2008 Just an FYI, user agent strings can be spoofed. You can never trust information coming from the users side. Quote Link to comment https://forums.phpfreaks.com/topic/111320-codes-only-run-in-firefox-how-to-do-so/#findComment-571598 Share on other sites More sharing options...
Darklink Posted June 23, 2008 Share Posted June 23, 2008 Well that's all fantastic for the user. What will they achieve exactly? You could only use such thing for statistics or changing HTML output anyway. If they spoof it, all they are going to get is an problem themselves. Quote Link to comment https://forums.phpfreaks.com/topic/111320-codes-only-run-in-firefox-how-to-do-so/#findComment-572632 Share on other sites More sharing options...
.josh Posted June 23, 2008 Share Posted June 23, 2008 Well that's all fantastic for the user. What will they achieve exactly? You could only use such thing for statistics or changing HTML output anyway. If they spoof it, all they are going to get is an problem themselves. Silly rabbit. Quote Link to comment https://forums.phpfreaks.com/topic/111320-codes-only-run-in-firefox-how-to-do-so/#findComment-572635 Share on other sites More sharing options...
DarkWater Posted June 23, 2008 Share Posted June 23, 2008 Well that's all fantastic for the user. What will they achieve exactly? You could only use such thing for statistics or changing HTML output anyway. If they spoof it, all they are going to get is an problem themselves. Silly rabbit. Trix are for kids. Anyway, you can break apart the user agent string with getbrowser(), which could be useful. But once again, it can be spoofed. Quote Link to comment https://forums.phpfreaks.com/topic/111320-codes-only-run-in-firefox-how-to-do-so/#findComment-572636 Share on other sites More sharing options...
thebadbad Posted June 23, 2008 Share Posted June 23, 2008 Check my earlier post, done in one line: http://www.phpfreaks.com/forums/index.php/topic,197980.msg893683.html#msg893683 *insert caution about spoofed user agent strings here* LOL Quote Link to comment https://forums.phpfreaks.com/topic/111320-codes-only-run-in-firefox-how-to-do-so/#findComment-572671 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.