わかりました、私はコールセンターで働いており、すべての発信者が取った休憩を示すモニターがあります。私はこの会社に入社したばかりで、このモニター用のウェブサイトを作成する任務を負っています。
以下は私のphpコードです。何が問題なのかを何時間も検索しましたが、見つからないようです。
問題は次のとおりです。ボタンをクリックすると、フォームが投稿されず、csv に書き込まれません。コードは以前に機能していたので、メイン行ではコードが正しいことを知っています。ばかげた小さなものに違いないのですが、見つかりません。
私のコード:
<html>
<head>
<LINK REL="StyleSheet" HREF="Input_form.css">
<title>Verander Plaatsindeling</title>
<h1><center>Verander plaatsindeling<center></h1>
<hr/>
</head>
<body>
<?php
if(ISSET($_POST['submitMe']))
{
$csv = fopen("zitplaatsenAntwerpen.csv","w") or die("Kan csv niet vinden!");
for($counter=1;$counter<=30;$counter++)
{
$naam = $_POST["Naam" .$counter];
$project = $_POST["Project" .$counter];
$csvrow = $counter . ";" . $naam . ";" . $project . "\n";
fwrite($csv, $csvrow);
}
?>
<?php
fclose($csv);
echo "<SCRIPT LANGUAGE='JavaScript'>
<!--
window.alert('Gegevens ingeladen!')
// -->
</SCRIPT>";
$informatie = array();
$f = fopen("ZitplaatsenAntwerpen.csv","r") or die("Kan csv niet vinden!");
while (!feof($f))
{
$arrM = explode(";",fgets($f));
$informatie[$arrM[0]]["Nummer"] = ucwords($arrM[0]);
$informatie[$arrM[0]]["Naam"] = ucwords($arrM[1]);
$informatie[$arrM[0]]["Project"] = ucwords($arrM[2]);
}
fclose($f);
}
else
{
$informatie = array();
$f = fopen("ZitplaatsenAntwerpen.csv", "r") or die("Kan csv niet vinden!");
while (!feof($f))
{
$arrM = explode(";",fgets($f));
$informatie[$arrM[0]]["Nummer"] = ucwords($arrM[0]);
$informatie[$arrM[0]]["Naam"] = ucwords($arrM[1]);
$informatie[$arrM[0]]["Project"] = ucwords($arrM[2]);
}
fclose($f);
}
?>
<div style="word-spacing:7em;" align:center>
Nummer Naam Project
</div>
<pre><form action="<?php echo $PHP_SELF;?>" method="post">
<?php
for ($teller = 1;$teller<=30; $teller++)
{
if(!empty($informatie[$teller]))
{
echo "<div align:center>";
echo " " . $teller . " ";
echo "<input type='text' name='Naam" .$teller. "' value='";
echo $informatie[$teller]["Naam"] . "'>";
echo "<input id='" .$teller. "' ";
echo "<input type='text' name='Project" .$teller. "' value='";
echo $informatie[$teller]["Project"] . "'>";
echo "</div>";
}
else
{
echo "<div align:center>";
echo " " . $teller . " ";
echo "<input type='text' name='Naam" .$teller. "' value='";
echo $informatie[$teller]["Naam"] . "'>";
echo "<input id='" .$teller. "' ";
echo "<input type='text' name='Project" .$teller. "' value='";
echo $informatie[$teller]["Project"] . "'>";
echo "</div>";
}
}
?>
</form></pre>
<div align="center">
<button style="width:100;height:50" type="submit" name="submitMe">Opslaan</button>
</div>
</body>
</html>
どんな助けでも大歓迎です。よろしくお願いします