永发信息网

将此代码转换成php

答案:2  悬赏:70  手机版
解决时间 2021-05-02 22:30
  • 提问者网友:我是我
  • 2021-05-02 13:40

<%
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
%>

最佳答案
  • 五星知识达人网友:逃夭
  • 2021-05-02 14:01
<?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;
}
}
?>
全部回答
  • 1楼网友:孤老序
  • 2021-05-02 15:21

<?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;
}
}
?>

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯