witam otoz mam taki problem mam sys newsow i jest cos takiego
dodawanie>podglad (cofnij [edycja - ladowanie strony z wypelnionymi plami) , dodaj [dodanie wpisu do mysql]) i wszystko jestr niby ok podglad z podlgadu do zmiany zmiana i podglad i dodanie tez dziala tylko zamiast tego co bylo w polach formularza dodaje takie cos
$tytul 14.02.2007, 10:50
$tresc
dodaje takze caly kod od dodawnia
<?php
//********************************************************************************
******************
if(isset($_GET['action']) && $_GET['action']=='preview') {
//krotkie zmienne
$tytul=$_POST['tytul'];
$autor=$_POST['autor'];
$zrodlo=$_POST['zrodlo'];
$tresc=$_POST['tresc'];
// link do edycji danych
echo '<input type="hidden" name="tytul" value="'; echo $tytul; echo '">'; echo '<input type="hidden" name="autor" value="'; echo $autor; echo '">'; echo '<input type="hidden" name="zrodlo" value="'; echo $zrodlo; echo '">'; echo '<input type="hidden" name="tresc" value="'; echo $tresc; echo '">';
echo '<center><input type="submit" value="< Edytuj" class="button"></center>';
//link do dodania newsa
echo '<form method="POST" action="news.php?action=add">';
echo '<input type="hidden" name="tytul" value="$tytul">'; echo '<input type="hidden" name="autor" value="$autor">'; echo '<input type="hidden" name="zrodlo" value="$zrodlo">'; echo '<input type="hidden" name="tresc" value="$tresc">';
echo '</b><P></P><p align="justify">'; echo '</p><P></P><i>Autor</i>: '; echo '<br><i>Źródło</i>: <a href='; echo '<center><input type="submit" value="Dodaj >" class="button"></center>';
}
//********************************************************************************
******************
elseif(isset($_GET['action']) && $_GET['action']=='pedit') {
//krotkie zmienne
$tytul=$_POST['tytul'];
$autor=$_POST['autor'];
$zrodlo=$_POST['zrodlo'];
$tresc=$_POST['tresc'];
echo '<input type="hidden" name="tytul" value="'; echo $tytul; echo '">'; echo '<input type="hidden" name="autor" value="'; echo $autor; echo '">'; echo '<input type="hidden" name="zrodlo" value="'; echo $zrodlo; echo '">'; echo '<input type="hidden" name="tresc" value="'; echo $tresc; echo '">';
echo 'Edycja danych / Dodawanie nowego newsa: <P></P> <form method="POST" action="news.php?action=preview">
<table class="text">
<tr><td widht="50px"><b>Tytuł </b></td><td widht="10px"><b>:</b></td>
<td width="150px"><input type="text" name="tytul" value="'; echo $tytul; echo '" size="34" class="formularz"> </td></tr> <tr><td widht="50px"><b>Autor </b></td><td widht="10px"><b>:</b></td>
<td width="150px"><input type="text" name="autor" value="'; echo $autor; echo '" size="34" class="formularz"> </td></tr> <tr><td widht="50px"><b>Źródło </b></td><td widht="10px"><b>:</b></td>
<td width="150px"><input type="text" name="zrodlo" value="'; echo $zrodlo; echo '" size="34" class="formularz" value="http://"> </td></tr> <tr><td widht="50px" valign="top"><b>Treść </b></td><td widht="10px" valign="top"><b>:</b></td>
<td width="150px"><textarea name="tresc" cols="70" rows="10" class="textera">'; echo $tresc; echo '</textarea></td></tr> <tr><td width="150px" colspan="3"><center><input type="submit" value="Podgląd" class="button"></center></td></tr>
</table><P></P>
<table class="text">
<tr><td widht="50px"><b>Wstaw </b></td><td widht="10px"><b>:</b></td>
<td width="300px">
<input type="submit" value="B" class="button">
<input type="submit" value="I" class="button">
<input type="submit" value="U" class="button">
<input type="submit" value="UL" class="button">
<input type="submit" value="LI" class="button">
<input type="submit" value="TB" class="button">
<input type="submit" value="TD" class="button">
<input type="submit" value="TR" class="button">
</td>
</tr>
</table>
</form>
';
}
//********************************************************************************
******************
elseif(isset($_GET['action']) && $_GET['action']=='add') {
//krotkie zmienne
$tytul=$_POST['tytul'];
$autor=$_POST['autor'];
$zrodlo=$_POST['zrodlo'];
$tresc=$_POST['tresc'];
$data=date('d.m.Y, H:i');
mysql_query("INSERT INTO news VALUES(0,'$tytul','$autor','$zrodlo','$tresc','$data')"); echo 'Dodałem newsa! <br> <a href=../index.php>Strona główna</a>';
}
//********************************************************************************
****************
else echo 'Dodawanie nowego newsa <P></P> <form method="POST" action="news.php?action=preview">
<table class="text">
<tr><td widht="50px"><b>Tytuł </b></td><td widht="10px"><b>:</b></td>
<td width="150px"><input type="text" name="tytul" size="34" class="formularz"> </td></tr>
<tr><td widht="50px"><b>Autor </b></td><td widht="10px"><b>:</b></td>
<td width="150px"><input type="text" name="autor" size="34" class="formularz"> </td></tr>
<tr><td widht="50px"><b>Źródło </b></td><td widht="10px"><b>:</b></td>
<td width="150px"><input type="text" name="zrodlo" size="34" class="formularz" value="http://"> </td></tr>
<tr><td widht="50px" valign="top"><b>Treść </b></td><td widht="10px" valign="top"><b>:</b></td>
<td width="150px"><textarea name="tresc" cols="70" rows="10" class="textera"></textarea></td></tr>
<tr><td width="150px" colspan="3"><center><input type="submit" value="Podgląd" class="button"></center></td></tr>
</table><P></P>
<table class="text">
<tr><td widht="50px"><b>Wstaw </b></td><td widht="10px"><b>:</b></td>
<td width="300px">
<input type="submit" value="B" class="button">
<input type="submit" value="I" class="button">
<input type="submit" value="U" class="button">
<input type="submit" value="UL" class="button">
<input type="submit" value="LI" class="button">
<input type="submit" value="TB" class="button">
<input type="submit" value="TD" class="button">
<input type="submit" value="TR" class="button">
</td>
</tr>
</table>
</form>
';
}
?>
moze wy wiecie jak to nareperowac bo ja nie :/