|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Redirect if not a wap browser
hello:
i'm using WURFL to detect if user agent is a "wap browser". code to detect wap browser. Code:
require_once('wurfl_class.php');
$device=new wurfl_class($_SERVER['HTTP_USER_AGENT']);
if($device->browser_is_wap){
header("Content-type: text/vnd.wap.wml, true");
echo '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n";
} else {
// redirect to other page
}
// other codes here
when trying to go to "http://www.domainname.com/wap"; the web browser redirects me to the "index.php"..which is ok. but when trying to use an emulator ("smart phone emulator 6")...it displays an error: "Reply Unknown" any input is appreciated. thanks in advance.
__________________
*** today i ask, tomorrow i help - sandbag |
|
#2
|
||||
|
||||
|
Does wurfl recognize the emulator as a wap device?
It may not be redirecting. Alternatively, can the emulator handle redirects? If you are redirecting for non-wap devices, perhaps you could kill the script after redirect so nothing else happens... PHP Code:
__________________
Cheers, Jamie # mdb4u | mobile movie database] | Please help to test and promote # skiFFie | Home of the 'accessibility module' for Drupal # Jamie Burns [me] Accessibility Module [drupal] # guidelines | search | wap resources | not getting help | fold to cure __________________ Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. ![]() __________________ |
|
#3
|
|||
|
|||
|
hello:
this is working fine now. thanks jabba |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Mobile Programming > Redirect if not a wap browser |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|