Hi!
I need to show message and use a Display text element (Eval activated) if the user has win 7 as OS.
Have tested this this borrowed code, but the message isn't shown (no errors):
What do I miss?
The code it self is working fine when I test it in a separate php-page.
Regards
Matt
I need to show message and use a Display text element (Eval activated) if the user has win 7 as OS.
Have tested this this borrowed code, but the message isn't shown (no errors):
PHP:
$user_agent = $_SERVER['HTTP_USER_AGENT'];
function getOS() {
global $user_agent;
$os_array = array(
'/windows nt 6.1/i' => 'My message....'
);
foreach ($os_array as $regex => $value) {
if (preg_match($regex, $user_agent)) {
$os_platform = $value;
}
}
return $os_platform;
}
$user_os = getOS();
print_r ($device_details);
What do I miss?
The code it self is working fine when I test it in a separate php-page.
Regards
Matt