对ASP不了解了,不过你可以寻找一个asp2php的软件进行转换的。
解决方案 »
- php网页怎么访问加载activex
- 在php中向数据库写入发生错误,请大神看下....
- 通过STMP发邮件,这段代码错在哪?
- 字符串嵌套 匹配的问题
- 我做了一个web站点,有没有什么办法让一台机子不能同时打开两个我系统中的页面。
- 請問變量$_SESSION['a'],$_GET['a'],$_COOKIE['a']的區別
- 如何传递URL参数值呢?
- 能帮我推荐一个php在线编辑器吗?
- 如何计算超出1970 年2038 年日期之差
- 哪位的主页空间在NEXEN。NET??我有问题请教。。。
- 高手们帮个忙啊,谢了!!!
- 用Socket发送电子邮件,遇到“421 closing transmission channel”。怎么解决?
//??????
function GetBookInfo($UserName,$PassWord,$UUID,$bWithFile,$codec)
{
extract($GLOBALS);
// $cnnDBNet is of type "ADODB.Connection"
$strConn=$Application["Read_EnglishFreeNet2005_CStr"];
echo $strConn;
$a2p_connstr=;
$a2p_uid=strstr($a2p_connstr,'uid');
$a2p_uid=substr($d,strpos($d,'=')+1,strpos($d,';')-strpos($d,'=')-1);
$a2p_pwd=strstr($a2p_connstr,'pwd');
$a2p_pwd=substr($d,strpos($d,'=')+1,strpos($d,';')-strpos($d,'=')-1);
$a2p_database=strstr($a2p_connstr,'dsn');
$a2p_database=substr($d,strpos($d,'=')+1,strpos($d,';')-strpos($d,'=')-1);
$cnnDBNet=mysql_connect("localhost",$a2p_uid,$a2p_pwd);
mysql_select_db($a2p_database,$cnnDBNet);
// $rs is of type "ADODB.Recordset"
$strSQL="SELECT * FROM ex3_bookshelf WHERE BOOKLANGUAGE='".trim($codec)."' ORDER BY orderno";
$rs=mysql_query($strSQL); if ((($rs==0)))
{ print "Result=0";
$rs=null; mysql_close($cnnDBNet);
$cnnDBNet=null; return $function_ret; }
$nRecords=mysql_num_rows($rs_query);
$nFields=->$Count;
print $inttobinary[$nRecords];//??????,????????
print $inttobinary[$nFields+3]; for ($i=0; $i<=($nFields-1); $i=$i+1)
{
$FieldName=($i)->$Name;
$FieldName=trim($FieldName);
$FieldNameLen=strlen($FieldName);
print $Inttobinary[$FieldNameLen];
print $FieldName; }
print $Inttobinary[11];
print "lessontitle";
print $Inttobinary[9];
print "lessongif";
print $Inttobinary[13];
print "lessontasknum";
flush();
for ($i=0; $i<=($nRecords-1); $i=$i+1)
{
for ($j=0; $j<=($nFields-1); $j=$j+1)
{ if (!isset($rs[$j]))
{ print $inttobinary[0];
flush(); }
else
{ $str=trim($rs[$j]);
if (($j)$Name=="BOOKCOVER" && $bWithFile)
{ $url=$DataPath."\\".$rs["BOOKPATH"].$rs[$j];
// $fso is of type "Scripting.FileSystemObject"
$fl=getfile($url) /* don't know how to convert this filesystem method */
$flsize=filesize($fl);
$fl=null; $fso=null;
// $objStream is of type "ADODB.Stream"
$objStream->Mode=16;
$objStream->Open;
$objStream->Type=1;
$objStream->LoadFromFile$url;
$data=$objStream->Read; $strLen=$stringLen[$str];
print $inttobinary[$strLen+$flsize+8];
print $inttobinary[$strLen];
print $str;
print $inttobinary[$flsize];
print $data;
flush(); ob_clean(); $objStream->Close;
$objStream=null; }
else
{ $strLen=$stringLen[$str];
print $inttobinary[$strLen];
print $str;
flush(); } }
}
// $rs2 is of type "ADODB.Recordset"
$strSQL="SELECT D_TITLE,D_TASKNUM FROM ".trim($rs["BOOKTABLENAME"])." ORDER BY D_RECNO";
$rs=mysql_query($strSQL); $totalstr="";
$totalstr2="";
$totalstr3="";
for ($k=0; $k<=(mysql_num_rows($rs2_query)-1); $k=$k+1)
{
$totalstr=$totalstr.trim(("D_TITLE")).chr(13)+chr(10);
$totalstr2=$totalstr2.trim(("D_TASKNUM")).".gif".chr(13)+chr(10);
$totalstr3=$totalstr3.trim(("D_TASKNUM")).chr(13)+chr(10);
$rs2=mysql_fetch_array($rs2_query);
}
print $inttobinary[$stringLen[$totalstr]];
print $totalstr;
print $inttobinary[$stringLen[$totalstr2]];
print $totalstr2;
print $inttobinary[$stringLen[$totalstr3]];
print $totalstr3;
flush();
$rs2=null;
$rs=mysql_fetch_array($rs_query);
} print "Result=1";
$rs=null; mysql_close($cnnDBNet);
$cnnDBNet=null;
return $function_ret;
}
?>帮你转了,不过能不能用就不知道了。。你试试。。
你这个代码应该和其它的代码有关联的。
1、给变量加上$前导
2、给每句加上结束符“;”
3、形如
set cnnDBNet = Server.CreateObject("ADODB.Connection")
的改为形如
$cnnDBNet = new com("ADODB.Connection");
4、& 改为 .
5、对象成员连接符由“.”改为“->”
如
totalstr = totalstr & Trim(rs2.Fields("D_TITLE")) & chr(13)+chr(10)
改做
$totalstr = $totalstr . trim($rs2->Fields("D_TITLE")) . chr(13).chr(10);
google一下asp2php你会找到那个软件的,然后自己转一下,再试试看。