<? //?????? 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; } ?>帮你转了,不过能不能用就不知道了。。你试试。。 你这个代码应该和其它的代码有关联的。
//??????
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你会找到那个软件的,然后自己转一下,再试试看。