witam!
Jak w temacie^
wpisuje dane do formularza wyświetla się napis że news został dodany (15 linijka) więc musiało prześć przez funkcje insert. Sprawdzam w bazie danych licze rekordów i nic.
<? include('..config.conf');
switch($_GET['send'])
{
case 'ok';
if(isset($_POST['temat']) && $_POST['temat']=='') $blad = 'Wypełnij pole tematu!</br>'; if(isset($_POST['tresc']) && $_POST['tresc']=='') $blad = 'Wypełnij pole treści!'; {
$tresc = $_POST['tresc'];
$temat = $_POST['temat'];
$id = "SELECT MAX('id') FROM news";
$data = "date(d M Y G:i:s)";
$zapytanie = "INSERT INTO news SET id='$id', temat='$temat', tresc='$tresc', data='$data', autor='$login' ";
echo '<p class="accept"><b>News został zamieszczony!</b></p> '; }
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="pl">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>Dodawanie Newsa</title>
</head>
<body>
<form method="POST" action="news.php?send=ok">
<table cellpadding="0" cellspacing="0" width="532" height="495">
<!-- MSTableType="layout" -->
<tr>
<td height="24" valign="top">Dodawanie Newsa:</td>
</tr>
<tr>
<td height="26" valign="top"><div class="error">
<? echo $blad; ?></div></td>
</tr>
<tr>
<td height="26" valign="top">Temat:
<input type="text" name="temat" size="88" class="input">
</form>
</td>
</tr>
<tr>
<td height="419" width="532">
<p>
<textarea rows="23" name="tresc" cols="63"></textarea></p>
<p><input type="submit" value="Dodaj" name="B1" class="przycisk"><input type="reset" value="Kasuj" name="B2" class="przycisk"></p></td>
</tr>
</table>
</body>
</html>
Ten post edytował grzeg123 17.03.2009, 16:09:11