Art of Mobile
Home GeneralHardwareJavaMMSPerlPHPSMSWAP


Do you want to have the same url for your Web and Wap broswer? The following is the code to do so in Perl:

#!/usr/local/bin/perl
use CGI;

my $query = new CGI;

my @list=$query->Accept();

my $htmlsite="http://www.artofmobile.com/index.html";
my $wmlsite="http://www.artofmobile.com/index.wml";

my $wml=0;
my $html=0;

foreach (@list) {
   $html=1 if /text\\\\/html/i;
   $wml=1 if  /wap/;
}

print $query->redirect($wmlsite)  if $wml==1;
print $query->redirect($htmlsite) if $html==1;
print $query->redirect($wmlsite);

Comments are closed.

Powered by WordPress. Theme created by Art Of Mobile