<html><head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"></head>
<?
$subject =$sub;
$name = $name;
$text = $text;
$action = $action;if ($action != "add")
{
$filepath = "guest.txt";
$f = fopen($filepath);
echo $f[0];
}if ($action == "add")
{
$filepath = "guest.txt";
$f=($filepath);
$total = substr($f[0],8); $total = $total + 1;
$ll = "&total=" . $total;
$ll = $ll . "&sub" . $total . "=" . $subject;
$ll = $ll . "&name" . $total . "=" . $name;
$ll = $ll . "&text" . $total . "=" . $text;
$fo = fopen($filepath,"w+");
fwrite($fo,$ll);
echo ("&added=1");
}
?>

解决方案 »

  1.   

    <html><head>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache"></head>
    <?
    $subject =$sub;
    $name = $name;
    $text = $text;
    $action = $action;if ($action != "add")
    {
    $filepath = "guest.txt";
    $f = file($filepath);
    echo $f[0];
    }if ($action == "add")
    {
    $filepath = "guest.txt";
    $f=file($filepath);
    $total = substr($f[0],8); $total = $total + 1;
    $ll = "&total=" . $total;
    $ll = $ll . "&sub" . $total . "=" . $subject;
    $ll = $ll . "&name" . $total . "=" . $name;
    $ll = $ll . "&text" . $total . "=" . $text;
    $fo = fopen($filepath,"w+");
    fwrite($fo,$ll);
    echo ("&added=1");
    }
    ?>