Chciałbym dodać do systemu newsów wybór kategorii. Same dodanie pola myślę nie było by dla mnie problemem ale jak zrobić to tak aby po wysłaniu formularza dana wiadomość faktycznie była w danej kategorii.
Plik dodaj.php
Kod
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="Description" content=" [Nowe spojrzenie na sport - relacje, wyniki i inne ciekawostki ze świata sportu] ">
<meta name="Keywords" content=" [sport, akcja, piłka, nozna] ">
<meta name="Author" content=" [dane autora] ">
<meta name="Generator" content="kED2">
<title>Panel dodawania newsów</title>
<link rel="stylesheet" href=" newsy.css " type="text/css">
</head>
<body><div id="strona"><form action="" method="post">
Tytuł: <br/><input type="text" name="tytul">
<br/>Autor: <br/><input type="text" name="autor">
<br/>Treść wiadomości: <br/><textarea name="tresc" rows="20" cols="50"></textarea>
<br/><br/><input type="submit" value="Dodaj"></form>
<?php
include("polacz.php");
$query = mysql_query("insert into news values('','".$_POST['tytul']."',now(),'".$_POST['autor']."','".$_POST['tresc']."')");
?></div></body>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="Description" content=" [Nowe spojrzenie na sport - relacje, wyniki i inne ciekawostki ze świata sportu] ">
<meta name="Keywords" content=" [sport, akcja, piłka, nozna] ">
<meta name="Author" content=" [dane autora] ">
<meta name="Generator" content="kED2">
<title>Panel dodawania newsów</title>
<link rel="stylesheet" href=" newsy.css " type="text/css">
</head>
<body><div id="strona"><form action="" method="post">
Tytuł: <br/><input type="text" name="tytul">
<br/>Autor: <br/><input type="text" name="autor">
<br/>Treść wiadomości: <br/><textarea name="tresc" rows="20" cols="50"></textarea>
<br/><br/><input type="submit" value="Dodaj"></form>
<?php
include("polacz.php");
$query = mysql_query("insert into news values('','".$_POST['tytul']."',now(),'".$_POST['autor']."','".$_POST['tresc']."')");
?></div></body>