asp转PHP

来源:百度知道 编辑:UC知道 时间:2024/07/02 14:51:37
<%
if Request.servervariables("server_name")<>"www.t775.com" then
response.write "对不起,该网站程序只允许在域名www.t775.com下授权使用!"
response.end
end if
%>
<%
dim a(2)
randomize
t=int(rnd*2)
a(0)="http://127.0.0.1:881/"
a(1)="http://127.0.0.1:881/"
Response.write a(t)&request("url")
%>
谁帮忙把这段ASP代码转换为PHP的

<?php

$PHP_DOMAIN = $_SERVER['SERVER_NAME'];
$PHP_DOMAIN=='www.t775.com' or die('对不起,该网站程序只允许在域名www.t775.com下授权使用!');
$URL=time() % 2==0 ? 'http://127.0.0.1:881/' : 'http://127.0.0.1:882/';
$YOUR_URL=$_SERVER['REQUEST_METHOD'] == 'POST' ?$_POST['url'] :$_GET['url'];
echo $URL.$YOUR_URL;
//觉得好就加分吧..
?>

PHP里也可以执行吧!