ok scusa spero vada meglio.
codice:
</head>
<body>
<div id="wrapper">
<div id="header-wrapper" class="container">
<div id="header" class="container">
<div id="logo">
<h1>Blog in php </h1>
</div>
<div id="menu">
<ul>
<li class="current_page_item">Homepage
[*]Some Photos
[*]About me
[*]Contact me
[/list]
</div>
</div>
<div>[img]images/img03.png[/img]</div>
</div>
<div id="page">
<div id="content">
<div class="post">
<h2 class="title">Lorem ipsum sed aliquam</h2>
<p class="meta"><span class="date">August 20, 2012</span><span class="posted">Posted by Someone</span></p>
<div style="clear: both;"></div>
<div class="entry">
Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer. Donec ipsum. Proin imperdiet est. Phasellus dapibus semper urna. Pellentesque ornare, orci in consectetuer hendrerit, urna elit eleifend nunc, ut consectetuer nisl felis ac diam. Etiam non felis. Donec ut ante. In id eros. Suspendisse lacus turpis, cursus egestas at sem. Mauris quam enim, molestie in, rhoncus ut, lobortis a, est.</p>
<p class="links">Read MoreComments</p>
</div>
</div>
<div class="post">
<h2 class="title">Consecteteur hendrerit </h2>
<p class="meta"><span class="date">August 10, 2012</span><span class="posted">Posted by Someone</span></p>
<div style="clear: both;"></div>
<div class="entry">
Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer. Donec ipsum. Proin imperdiet est. Phasellus dapibus semper urna. Pellentesque ornare, orci in consectetuer hendrerit, urna elit eleifend nunc, ut consectetuer nisl felis ac diam. Etiam non felis. Donec ut ante. In id eros. Suspendisse lacus turpis, cursus egestas at sem. Mauris quam enim, molestie in, rhoncus ut, lobortis a, est.</p>
<p class="links">Read MoreComments</p>
</div>
</div>
<div style="clear: both;"></div>
</div>
<div id="sidebar">
<ul>
[*]
<div id="search" >
<form method="get" action="#">
<div>
<input type="text" name="s" id="search-text" value="" />
<input type="submit" id="search-submit" value="GO" />
</div>
</form>
</div>
<div style="clear: both;"></div>
[*]
questo e la index.php
codice:
<?
@require "anteprima.php";
$sql = "SELECT * FROM articoli ORDER BY art_data DESC";
$query = @mysql_query($sql) or die (mysql_error());
if(mysql_num_rows($query) > 0){
while($row = mysql_fetch_array($query)){
$art_id = $row['art_id'];
$autore = stripslashes($row['art_autore']);
$titolo = stripslashes($row['art_titolo']);
$data = $row['art_data'];
$articolo = stripslashes($row['art_articolo']);
$link = " ..
<a href=\"articolo.php?id=$art_id\">Leggi tutto</a>";
echo "<h2>".$titolo."</h2>";
echo @anteprima($articolo, 30, $link);
echo "
";
$data = preg_replace('/^(.{4})-(.{2})-(.{2})$/','$3-$2-$1', $data);
echo "Scritto da ". $autore . "";
echo "| Articolo postato il " . $data . "";
echo "| Commenti: ";
$conta = "SELECT COUNT(com_id) as conta from commenti WHERE com_art = '$art_id'";
$conto = @mysql_query ($conta);
$tot = @mysql_fetch_array ($conto);
echo $sum2 = $tot['conta'];
echo "<hr>";
}
}else{
// se in tabella non ci sono records...
echo "Nessun articolo presente.";
}
?>