<?php $podpis = escape_data($_POST['podpis']); $tytul = escape_data($_POST['tytul']); $tresc = escape_data($_POST['tresc']); $ip=$REMOTE_ADDR; $host=gethostbyaddr($ip); $query2 = "INSERT INTO ksiega_gosci ( podpis, tytul, tresc, data, ip, host, publikuj) VALUES ( '$podpis', '$tytul', '$tresc', NOW(), '$ip', '$host', nie )"; } echo '<form name="wpisz" action="index.php?ksiega" method="post"> <tr><td class="t11_w">Temat: <br> <input type="text" name="tytul" size="50"/></td></tr> <tr><td class="t11_w">Treść: <br><textarea name="tresc" cols="50" rows="8"></textarea></td></tr> <tr><td class="t11_w">Popis: <br><input type="text" name="podpis" /></td></tr> <input type="hidden" name="ip" value="'.$ip.'" /> <input type="hidden" name="host" value="'.$host.'" /> <tr><td align="center"><table><input type="submit" name="wpisz" value="Wyślij" /></form><form name="anuluj" action="index.php?ksiega" method="post"><input name="anuluj" type="submit" value="Anuluj" /></form></table></td></tr> '; } else { echo '<tr><td background="pliki/wz.gif" align="right" height="30"><a href="index.php?ksiega&dodaj"><font color="001864"><b>Dodaj swój wpis</b></font></a> </td></tr>'; $query2 = "SELECT * FROM ksiega_gosci ORDER BY wpis_id DESC"; $bg='#FBEAEA'; if ( $numr > 0 ) { echo '<tr> <td valign="top" rowspan="2"><img src="pliki/komentarz.gif"></td> <td><b>'.$rew['tytul'].'</b></td> <td>'.$rew['data'].'</td> </tr> <tr><td>'.$rew['tresc'].'</td><td>'.$rew['autor'].'</td></tr>'; } } } ?>