Detect IE in PHP then open webpage [duplicate] - php

This question already has answers here:
PHP: If internet explorer 6, 7, 8 , or 9
(17 answers)
Closed 8 years ago.
How can i detect any-IE in php , if any-ie then continue open page,
else non-ie this page can't open page then show error?
I'm using $_SERVER['HTTP_USER_AGENT'] to detect user's browser..
thx u lot.

$browser = get_browser(null, true);
if($browser['browser'] != 'Internet Explorer') {
die('Only IE');
}
See http://php.net/manual/en/function.get-browser.php

Related

Find Windows devices using Javascript? [duplicate]

This question already has answers here:
What is the list of possible values for navigator.platform as of today? [closed]
(3 answers)
Closed 5 years ago.
How to find Windowow devices using Javascript or jquery
use 'navigator.platform' to check what platform you are using.
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/platform
function isWindows() {
return navigator.platform.indexOf('Win') > -1
}
// Maybe Try this on android deveices
function isAndroid() {
return navigator.platform.indexOf('android') > -1
}

About Removing a cookie in PHP [duplicate]

This question already has answers here:
Remove a cookie
(24 answers)
Closed 7 years ago.
How can i make a cookie removed while someone clicks the logout button?
Here is the code which i used but didn't work through:
<?php
setcookie('name','value',time()-600, '/', '', 0);
?>
Since I am not that much expert in PHP. Any Help?
if (isset($_COOKIE['name'])) {
unset($_COOKIE['name']);
setcookie('name', null, -1, '/');
}

How to check if an HTML textbox contains a web url? [duplicate]

This question already has answers here:
How to check if page url has www in it or not with PHP?
(6 answers)
Closed 8 years ago.
I am creating a frontend form in WordPress where I am using a simple HTML textbox to input a web url. Now I want to check if the value entered is a URL and not just any random text. Anyway to do that?
if (str[i] == 'w' && str[i+1] == 'w' && str[i+2] == 'w' && str[i+3] == '.')
return (1);

How to detect ANY Internet Explorer in PHP? [duplicate]

This question already has answers here:
PHP detect Internet Explorer that is below version 10
(3 answers)
Closed 8 years ago.
The question is, how to detect any IE version using PHP?
I seen PHP scripts that detect specific versions of IE, but I was unable to find a way to detect any version of IE. Thanks for your help.
<?php
function ae_detect_ie()
{
if (isset($_SERVER['HTTP_USER_AGENT']) &&
(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
return true;
else
return false;
}
?>
taken from : http://www.anyexample.com/programming/php/how_to_detect_internet_explorer_with_php.xml

Anti-Frame Busting code? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
My frame is redirecting page !! How to stop it ?
Is there any code like that ?
Please help..Thanks
If you mean a code that detects if it's in a frame, and if so, change the target location?
if (parent.frames.length > 0) parent.location.href = location.href;

Categories