plik z podgladem newsa (ten w ktorym sa komentarze)
<?
lacz();
$id = $_GET['id'];
if (!$id) {
echo"<table bgcolor=3e3e3e border=0 width=600 align=center cellpadding=0 cellspacin
g=0> <tr><td bgcolor=3e3e3e width=100% class=news>Strona wywolana w nieprawidlowy sposob. Poruszaj sie za pomoca linkow.</td></tr>
</table><br>";
}
$zapytanie = "SELECT * FROM `newsy` WHERE id = $id";
echo"<table bgcolor=3e3e3e border=0 width=600 align=center cellpadding=0 cellspacin
g=0> <tr><td bgcolor=3e3e3e width=100% class=news><span class=title>$row[title]</span> // $row[data]";
<font align=justify>".stripslashes($row[tresc
])."</font> </td></tr> <tr><td bgcolor=505050 width=100% height=25 class=news><right><b>Autor:</b> $row[autor]</td></tr>
</table><br>";
}
//***********************************/
// KOMENTARZE /
//***********************************/
$ile = 15;
if(!$p) $p = 0;
$zapytanie = "SELECT * FROM `komentarze` WHERE id_news = $id ORDER BY `id` DESC LIMIT $p,
$ile";
echo "<table bgcolor=505050 border=0 width=600 align=center cellpadding=0 cellspacin
g=0>"; {
echo "<tr><td bgcolor='505050' width='100%' class=news><b>".$row['autor']."</b><br>".stripslashes($row[tresc
])."<br></td></tr>"; $i++;
}
?>
<form method="post" action="index.php?co=wiecej&id=<?=$_GET['id']?>">
<table bgcolor=3e3e3e border=0 width=600 align=center cellpadding=0 cellspacin
g=0 class=news>
<?
####################
# Dodawanie koentów
####################
if($send=='Skomentuj')
{
{
echo "<tr><td><b>Nie wypełniłeś wszystkich pól.</b></td></tr>"; }
if (!ereg('[a-zA-Z0-9-.,]+', $tresc)) {
echo "<tr><td><b>Treść zawiera nieprawidłowe znaki.</b></td></tr>"; }
$zapytanie = "INSERT INTO `komentarze` values ('', '$_GET[id]', '$autor', '$tresc')";
if (!$wykonaj)
{
echo "<tr><td><b>Komentarz nie mógł zostać dodany</b></td></tr>"; }
header ('Location: index.php?co=wiecej'); }
?>
<tr><td>Nick: </td><td><input type="text" class="t1" name="autor"></td></tr>
<tr><td>Tresc: </td><td><TEXTAREA name="tresc" rows="4" cols="30" wrap="virtual" style="font-family:verdana, tahoma, sans-serif; font-size:11px; color:#000066; border: 1px solid #000066"></TEXTAREA></td></tr>
<tr><td> </td><td><input type="submit" value="Skomentuj" name="send" class="t1"></td></tr>
</table>
</form>
<?
#### STRONY ####
echo "<table border=0 width=600 align=center cellpadding=0 cellspacing=0 class=news>"; echo "<tr><td align=right class=strona>strona: "; for($i=0;$i<ceil($numrows/$ile);$i++) {
echo '<a class="a1" href="index.php?co=wiecej&id='.$id.'&p='.($i*$ile).'">'.($i+1).'</a> '; }
?>
index.php
?>
<html>
<head>
<title>Portal Newsowy - v 1.0.</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="Ppx.pl - kanal rss" href="rss.php" />
</head>
<body><br>
<table border="0" width="600" height="80" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="news" bgcolor="#3e3e3e" align="left" valign="middle">
<a href="index.php"><img src="img/top.gif" border="0"></a>
</td>
</tr>
</table>
<table border="0" height="25" width="600" align="center" cellpadding="0" cellspacing="0">
<tr><td width="100%" height="100%"></td></tr>
</table>
<?
if($co=="newsy") { include "inc/newsy.php"; }
elseif($co=="viewprofil") { include "inc/profil.php"; }
elseif($co=="wiecej") { include "inc/wiecej.php"; }
else { include "inc/newsy.php"; }
?><br>
</body>
</html>
Proszę bardzo (IMG:
http://forum.php.pl/style_emoticons/default/winksmiley.jpg)