Kod
function komentarze($ip, $id)
{
echo "<form method='POST' action='news.php?id=$id'>";
echo "<p>E-mail:<br>";
echo "<input type='text' name='email2' size='54'><br>";
echo "Treść komentarza:<br>";
echo "<textarea rows='9' name='komentarz2' cols='61'></textarea></p>";
echo "<br><input type='submit' value='Dodaj komentarz' name='komentuj2'></p>";
echo "</form>";
mysql_select_db('usport_2');
mysql_query("INSERT INTO cms_news_komentarze (id, email, komentarz, ip) VALUES ('NULL', '$email2', '$komentarz2', '$ip')");
}
komentarze($ip, $id);
{
echo "<form method='POST' action='news.php?id=$id'>";
echo "<p>E-mail:<br>";
echo "<input type='text' name='email2' size='54'><br>";
echo "Treść komentarza:<br>";
echo "<textarea rows='9' name='komentarz2' cols='61'></textarea></p>";
echo "<br><input type='submit' value='Dodaj komentarz' name='komentuj2'></p>";
echo "</form>";
mysql_select_db('usport_2');
mysql_query("INSERT INTO cms_news_komentarze (id, email, komentarz, ip) VALUES ('NULL', '$email2', '$komentarz2', '$ip')");
}
komentarze($ip, $id);
Nie wiem czemu, ale ten formularz nie działa - dodają się puste rekordy w bazie bez treści. Co w nim nie tak?