UserAgent detection in WML Script

168 Views Asked by At

I'm developing a WAP site for J2ME and low end Symbian phones. When the site is opened on non WAP browsers such as Chrome or Safari, the raw WML code is displayed.

I wanted to know if there's a way in WML to check the browser or user agent on which the page is opened. The objective is to detect the browser and redirect to WML or HTML pages based on the result.

1

There are 1 best solutions below

2
yardie On

This can not be done with pure WML. You can use PHP + WML and check the browser agent with PHP code:

echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";