Ik heb net de nieuwe functie fread geprobeerd,

Nu zit ik tegen een probleem aan: Steeds als ik een nieuw onderwerp maak dan voegt hij het simpel weg toe

Eerst verpakt hij de ouwe file in een $var
Daarna het nieuwe bericht in een adnere $var
En daarna schuift hij ze achter elkaar weg,

Nu komt er de hele tijd een :

,

tussen (plus die enters)

Hoe verkom ik dat ?

Script:

<?
//variablen
$titel = $_POST['T1'];
$tekst = $_POST['S1'];
$datum = date("d-m-Y / H:i"); 
$index = "index.htm";
$archief_index = "./archief/archief.txt";

//index.htm aanpassen
$index_handle = fopen($index, "a+");
$oud_index= fread($index_handle, filesize($index));
fclose($index_handle);
unlink($index);
$index_handle = fopen($index, "a+");
$index_write = '
<html>

<head>
<meta http-equiv="Content-Language" content="nl">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>' . $titel . '</title>
</head>

<body>

<p><font size="5" color="#0066FF" face="Elephant">' . $titel . '</font><font size="4" color="#0066FF" face="Arial Black"><br>
</font><font size="2" color="#C0C0C0" face="Times New Roman"><i>Gepost op: ' . $datum . '</i><br>
</font><font size="2" face="Arial" color="#C0C0C0"><br>
</font><font face="Arial">' . $tekst . '</font></p>
<p align="left"><font face="Times New Roman" color="#0066FF"><a href="archief/' . $titel . '.txt">
<span style="text-decoration: none">Reacties</span></a></font></p>

</body>

</html>';
fputs($index_handle, "$index_write, $oud_index");

//link toevoegen aan het archief

$archief_index_handle = fopen($archief_index, "a+");
$oud_archief = fread($archief_index_handle, filesize($archief_index));
fclose($archief_index_handle);
unlink($archief_index);
$archief_index_handle = fopen($archief_index, "a+");
$archief_index_write = '<a href="' . $titel . '.txt"><span style="text-decoration: none">
' . $titel . '</span></a></p>';
fputs($archief_index_handle, "$archief_index_write, $oud_archief");

//<p align="center"><a href="' . $titel . '.txt"><span style="text-decoration: none">
//' . $titel . '</span></a></p>

//archief bestand aanmaken voor archief
$archief = "./archief/" . $titel . ".txt";
$archief_write = '
<html>

<head>
<meta http-equiv="Content-Language" content="nl">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Turn Selectie A.G.A.</title>
</head>

<body>

<p><font size="5" color="#0066FF" face="Elephant">' . $titel . '</font><font size="4" color="#0066FF" face="Arial Black"><br>
</font><font size="2" color="#C0C0C0" face="Times New Roman"><i>Gepost op: ' . $datum . '</i><br>
</font><font size="2" face="Arial" color="#C0C0C0"><br>
</font><font face="Arial">' . $tekst . '</font></p>

</body>

</html>';
$archief_handle = fopen($archief, "a+");
fwrite($archief_handle, $archief_write);
fclose($archief_handle);

//tekst als het nieuws is toegevoegd
echo 'Het nieuwsbericht is succesvol gepost! Groeten Wessel Huising.<br/>';
echo "<a href=\"index.htm\">Ga naar het Nieuws!</a>"; //waar het nieuws staat! Dus verander de link!
?>
Haha! bedankt ik ga het gelijk verwerken,

Reageren