Browser detection in PHP causes white screen [closed]

This is my first comment here sorry if its not perfect. I think its because you’re trying to echo everything at once. <?php if (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Firefox’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Chrome’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Opera’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Safari’) !== FALSE) { $str=”<script>$(document).click(function() {“; $str .= ‘ window.open(“http://google.com”, “_blank”);’; $str .= ‘ });’; … Read more