Hello all, I need help with convertion PHP code to ASP - <?PHP $user_browser = strtolower($_SERVER["HTTP_USER_AGENT"]); echo "user_browser: $user_browser<br />"; function check_for_mobile($user_browser){ $mobile_browsers = array( 'android', 'avantGo', 'blackBerry', ); foreach ($mobile_browsers as $browser) { if (strstr($user_browser, $browser)) { return true; } } return false; } if(check_for_mobile($user_browser)){ ///looks like a mobile ... } else { echo "Regolar browser"; } ?> PHP: Thanks in advance, Roi
<% dim ua ua = Request.ServerVariables("HTTP_USER_AGENT") response.write("user_browser: " & ua & "<br />") function check_for_mobile(ua) dim browsers browsers = Array("android", "avantGo", "blackBerry") for each item in browsers if InStr(ua, item) > 0 then check_for_mobile = 1 exit function end if next check_for_mobile = 0 end function if check_for_mobile(ua) then response.write("Mobile browser") else response.write("Normal browser") end if %> Code (markup):