Mam taki kod
<?
include('../naglowek.php');
?>
<div id="tytul"><p><br><strong>Edytuj newsa</strong></p></div>
<?
require('../funkcje/db_connect.php');
if($_GET)
{
$newsid=$_GET['newsid'];
$sql="SELECT autor,tytul,tresc FROM newsy WHERE id=$newsid;";
{
$pobranyautor=$result['autor'];
$pobranytytul=$result['tytul'];
$pobranatresc=$result['tresc'];
}
}
if($_POST)
{
$title=$_POST['tytul'];
$text=$_POST['tekst'];
$author=$_POST['autor'];
$sql='UPDATE newsy SET autor="'.$author.'",tytul="'.$title.'",tresc="'.$text.'";';
}
?>
<form name="news" method="post" action="
<? echo($_SERVER['SCRIPT_NAME']); ?>">
<div id="news"><br>
<p>Tytuł newsa:<br>
<input type="text" name="tytul" value="
<? echo($pobranytytul); ?>"><br></p>
<p>Treść newsa:<br>
<textarea name="tekst" rows="5" cols="59">
<? echo($pobranatresc); ?></textarea><br></p>
<p>Autor:<br>
<input type="text" name="autor" value="
<? echo($pobranyautor); ?>"><br></p></div>
<div id="status"><br><p><input type="reset" value="Wyczyść">
<?
?><input type="submit" value="Wyślij"></div>
</form>
<?
include('../menu.php');
include('../stopka.php');
?>
Działa tylko ze zle zapisuje, tzn pod wszystkie inne newsy a nie aktulanie zmieniany
Pomozcie
Ten post edytował rneo23 13.12.2007, 19:23:10