ASP转换成PHP
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ASP转换成PHP相关的知识,希望对你有一定的参考价值。
Set rs= Server.CreateObject("adodb.recordSet")
Sql="Select * from admin"
rs.open Sql,conn,1,3
If not (rs.eof and rs.bof) then
php 怎么写
// 连接,选择数据库
$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('my_database') or die('Could not select database');
// 执行 SQL 查询
$query = 'SELECT * FROM my_table';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// 用 html 显示结果
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
echo "\t<tr>\n";
foreach ($line as $col_value)
echo "\t\t<td>$col_value</td>\n";
echo "\t</tr>\n";
echo "</table>\n";
// 释放结果集
mysql_free_result($result);
// 关闭连接
mysql_close($link);
?>
//以上摘自php5手册 参考技术A $rs=new COM("adodb.recordset");
$rs->open("select * from [admin] ",$conn,1,3);
if(!$rs->eof || !$rs->bof) 参考技术B $rs=new COM("adodb.recordSet");
$sql="Select * from admin";
$rs->open($Sql,conn,1,3);
if(!$rs->eof)
//就这样!
将asp代码转换成php代码
将此代码转换成PHP代码
<%
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
$ltype = trim($_GET['type']);
$username = trim($_GET['username']);
$password = trim($_GET['password']);
if($ltype === 1 || $ltype == 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>";
else if($ltype === 2 || $ltype == 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>";
else if($ltype === 3 || $ltype == 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>";
else
echo '<script>location.href="http://www.kcvg.cn/"</sctipt>';
?>
当然啦,想破解网易的“不安全网站效验”还是可以利用PHP伪造引用头的。
参考资料:http://www.kcvg.cn/
参考技术A 楼上正确可以用。这问题还匿名,绝对是人家做流氓型网址导航用的。以上是关于ASP转换成PHP的主要内容,如果未能解决你的问题,请参考以下文章