Kod
[php]
<?php
session_start();
include("baza.php");
$data = date("Y-m-d");
$_POST['tytul'] = $_SESSION['tytul'];
$_POST['tresc'] = $_SESSION['tytul'];
$_POST['tytul'] = $tytul;
$_POST['tresc'] = $tresc;
if(empty($tytul) or empty($tresc))
{
echo '<center>';
echo '<br />Wpisz treść newsa<br />';
echo '<a href="index.php">Wyloguj</a>';
}
else
{
$zapytanie = mysql_query("INSERT INTO `tabela3` (data,tytul,news)
VALUES ('$data','$tytul','$news')");
echo '<center>';
echo 'News dodany pomyślnie<br />';
echo '<a href="index.php">Wyloguj</a>';
}
session_destroy();
?>
[/php]
<?php
session_start();
include("baza.php");
$data = date("Y-m-d");
$_POST['tytul'] = $_SESSION['tytul'];
$_POST['tresc'] = $_SESSION['tytul'];
$_POST['tytul'] = $tytul;
$_POST['tresc'] = $tresc;
if(empty($tytul) or empty($tresc))
{
echo '<center>';
echo '<br />Wpisz treść newsa<br />';
echo '<a href="index.php">Wyloguj</a>';
}
else
{
$zapytanie = mysql_query("INSERT INTO `tabela3` (data,tytul,news)
VALUES ('$data','$tytul','$news')");
echo '<center>';
echo 'News dodany pomyślnie<br />';
echo '<a href="index.php">Wyloguj</a>';
}
session_destroy();
?>
[/php]
Jednak mimo że wpisuje do formularza dane, cały czas wywala: Wpisz treść newsa. Macie jakiś pomysł? Myślałem i myślałem i nic nie wymyśliłem.