#!/usr/bin/perl -w use strict; my $domain=$ENV{SERVER_NAME}; $domain=~s/^(www|wap|mail|bbs)\.//i; my $type=$ENV{HTTP_USER_AGENT}; my $accept=$ENV{HTTP_ACCEPT}; #if(($accept && $accept !~m/VND\.WAP\.WML/i) || ($type && ($type=~m/msie/i || $type=~m/Firefox\//i || $type=~m/Safari/i) && $type!~m/opera/i && $type!~m/mobile/i)) if(($accept && $accept=~m/VND\.WAP\.WML/i) || ($type && $type=~m/opera/i)) { print "Content-Type: text/vnd.wap.wml; charset=UTF-8\r\n\r\n"; print qq`

用户名:\@$domain
密 码:
登录 (所有手机适用)

`; } else { print "Content-Type:text/html\n\n"; print ' '; }