大家帮帮忙把asp程序改成php
下面的程序是asp和js的,我想把他改成php和js,帮帮忙
<%@language="javascript"%>
<%
var dbConn = Server.CreateObject("adodb.connection");
dbConn.Open(Application("strConn"));
var ResponseHTML = [];
function displayList(key, id){
var n = String(key).split("_").length;
var strSQL;
if (n == 1) {
strSQL = "select * from big order by id";
} else if (n == 2) {
strSQL = "select * from middle where parentid=" + id +" order by id";
} else {
strSQL = "select * from small where parentid=" + id + " order by id";
}
var objRs = dbConn.Execute(strSQL);
var tmp = [];
var x = 0;
while (!objRs.eof) {
var s = String(objRs("description").Value).replace(/\x27/g, "&");
tmp[tmp.length] = '["' + s + '","' + s + '"]';
if (n < 3) {
displayList(key + "_" + x, String(objRs("id")));
}
x++;
objRs.movenext;
}
objRs.Close();
objRs = null;
if (tmp.length > 0)
ResponseHTML[ResponseHTML.length] = ("dsy.add(\"" + String(key) + "\",[" + tmp.join(',') + "]);\n");
}
displayList(0);
dbConn.Close();
dbConn=null;
Response.Write(ResponseHTML.join(""));
%>