+ -
当前位置:首页 → 问答吧 → (求救) PHP Text-Base

(求救) PHP Text-Base

时间:2012-01-20

来源:互联网

本人用的 PHP 是 TEXT-BASE, 想求教, 如果我要删除或修改 TEXT-BASE 的某一行? PHP 该如何写??
在网上找到这 code, 不知怎的, 在自己的电脑可执行, 但UPLOAD了就不能?? >____<
万分感激!!


( HTML )
<form action="delete_file.php" method="post">
<input type="hidden" name="D[<?=$truecount;?>]" value="del">
<input type="Submit" name="Submit" value="删除">
</form>


( delete_file.php )
<?
$fp = "uploads/data.txt";
$LineArray = file("uploads/data.txt" );
$howmany = count($LineArray);
$fileopen = fopen($fp,"w+" );
fwrite($fileopen,"" );
fclose($fileopen);
$file=fopen($fp,"a+" );
$i=0;
while($i<$howmany)
{
if($D[$i]!="del" )
{
$guest[$i]=$LineArray[$i];
fwrite($file,$guest[$i]);
}
else
{
$guest[$i]=$LineArray[$i];
}
$i++;
}
fclose($file);
?>

[ 本帖最后由 mj_skh 於 2012-1-20 09:00 PM 编辑 ]

作者: mj_skh   发布时间: 1970-01-01

Anyone can help....??

作者: mj_skh   发布时间: 1970-01-01

热门下载

更多