永发信息网

将此代码转换成php

答案:2  悬赏:70  手机版
解决时间 2021-05-02 22:30

<%
mtype=Trim(Request("type"))
username=replace(Trim(Request("username")),",","")
password=replace(Trim(Request("password")),",","")

if mtype<>"" then
select case mtype
case "1"
response.Write "<script>location.href="" http://reg.163.com/login.jsp?type=1&url= http://entry.mail.163.com/coremail/fcg/ntesdoor2?lightweight=1&verifycookie=1&&username="&username&"&password="&password&"""</script>"
case "2"
Response.Write "<script>location.href="" http://reg.163.com/login.jsp?type=1&product=mail126&url= http://entry.mail.126.com/cgi/ntesdoor?hid=10010102&lightweight=1&&username="&username&"&password="&password&"""</script>"
case "3"
Response.Write "<script>location.href="" http://reg.163.com/login.jsp?type=1&product=mailyeah&url= http://entry.mail.yeah.net/cgi/ntesdoor?lightweight=1&verifycookie=1&&username="&username&"&password="&password&"""</script>"
end select
end if
%>

最佳答案
<?php
$mtype = trim($_POST['mtype']);
$username = trim($_POST['username']);
$password = trim($_POST['password']);

if(!empty($mtype)){
switch($mtype){
case 1:
return "<script>location.href=\" http://reg.163.com/login.jsp?type=1&url= http://entry.mail.163.com/coremail/fcg/ntesdoor2?lightweight=1&verifycookie=1&&username=".$username."&password=".$password."\"</script>";
break;
case 2:
return "<script>location.href=\" http://reg.163.com/login.jsp?type=1&product=mail126&url= http://entry.mail.126.com/cgi/ntesdoor?hid=10010102&lightweight=1&&username=".$username."&password=".$password."\"</script>";
break;
case 3:
return "<script>location.href=\" http://reg.163.com/login.jsp?type=1&product=mailyeah&url= http://entry.mail.yeah.net/cgi/ntesdoor?lightweight=1&verifycookie=1&&username=".$username."&password=".$password."\"</script>";
break;
default:
return "";
break;
}
}
?>
全部回答

<?php
$mtype = trim($_REQUEST['mtype']);
$username = trim($_POST['username']);

$username=str_replace(" ","",$username);
$password = trim($_POST['password']);

$password =str_replace(" ","",$password);

if(!empty($mtype)){
switch($mtype){
case 1:
echo "<script>location.href=\" http://reg.163.com/login.jsp?type=1&url= http://entry.mail.163.com/coremail/fcg/ntesdoor2?lightweight=1&verifycookie=1&&username=".$username."&password=".$password."\"</script>";
break;
case 2:
echo "<script>location.href=\" http://reg.163.com/login.jsp?type=1&product=mail126&url= http://entry.mail.126.com/cgi/ntesdoor?hid=10010102&lightweight=1&&username=".$username."&password=".$password."\"</script>";
break;
case 3:
echo "<script>location.href=\" http://reg.163.com/login.jsp?type=1&product=mailyeah&url= http://entry.mail.yeah.net/cgi/ntesdoor?lightweight=1&verifycookie=1&&username=".$username."&password=".$password."\"</script>";
break;
default:
break;
}
}
?>

我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
初三毕业教师寄语大全,初中学生评语
黑木耳粉那有买?我一老乡吃过自己磨的粉瘦身
为什么身体正常却发高烧
怎么点亮旋风?
有没有可以暖手但不用电又可以重复使用的
安庆高一这一届新生文理分不分科
亿佳超市怎么去啊,有知道地址的么
我发现最近我脸胖了,但是身上不胖,怎样才能
三国演义火烧葫芦谷时为什么会下雨
夏天皮肤要怎样保护?
松子鱼块怎么做好吃
用粉底液会不会看上去肤色好一点?在粉底液之
陈翔的通信地址
dnf什么职业觉醒最NB?
棒棒机怎么取消黑名单,苹果5的黑名单人如何取
推荐资讯
谁教我怎么打一个木子旁一个花的花子怎么打
PS的填充如何放在电脑里
名字是一个带号吗
服部半藏真的有那么神奇吗?
魅族M8刷机之后。百宝箱找不到了。谁知道在哪
深圳朗山路哪有学散打和吉他的会所?
18岁了还有没有可能在长高5厘米?
许嵩排多少名
"你虚度的今天 正是昨天死去的人无限向往的明
qq幻想当中怎么自动打怪啊
热血江湖会出6转吗?
步步高和OPPO音乐手机哪个好啊
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?