U nie już wszystko prawie działa, ale teraz nie chce pobierać zmiennych z pliku może któś mi pomorze?
Odczytywanie:
[php:1:a36dfc2ae6]
<?php
$file=fopen("forumposts.txt", "r");
flock($file, 1);
while($linia=fgets($file, 81))
{
echo($linia);
}
fclose($file);
?>
[/php:1:a36dfc2ae6]
Formularz:
Kod
<FORM ACTION="dodajpost.php" METHOD="POST">
<B>Nick</B> <INPUT TYPE="TEXT" NAME="Nick"><BR>
<B>Temat</B> <INPUT TYPE="TEXT" NAME="Temat"><BR><BR>
<B>Tresc</B><BR>
<BR>
<TEXTAREA name="Tresc" cols=35 rows=7> </TEXTAREA><BR><BR>
<INPUT TYPE="SUBMIT" NAME="Dodaj" VALUE="Dodaj">
</FORM>
I oczywiście dodajpost.php:
[php:1:a36dfc2ae6]
<?
if($fd = @fopen('forumposts.txt', a)){
$Data = date('d-m-Y');
$str = "<table width='388' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td background='gfx/dzielnik.gif' width='388' height='19'> <b><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>
'$Temat' By $Nick</font></b></td>
</tr>
</table>
<table width='417' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td>
<div align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>
$Tresc<B>($Data)</B>
</font></div>
</td>
</tr>
</table><BR><BR>";
fwrite($fd, $str);
fclose($fd);
}
header("Location: forum.php");
?>
[/php:1:a36dfc2ae6]
Proszę o pomoc dlaczego nie pobiera zmiennych z formularza?