@edo98:
1) I dati li prende dal database
2) Usi una sintassi davvero sbagliata
@zomer:
Codice PHP:
<?php
$contatore = 0;
// Includo la connessione al database
require('config.ini.php');
$query = mysql_query('SELECT * FROM blog');
if(!$query){ /*eseguo la query e controllo se va a buon fine ^^*/ die('Errore: non riesco a eseguire la query'); }
$array = mysql_fetch_array($query);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> <?php echo $array['nome']; ?> - Zomer Blog</title>
<style type="text/css">
body{
background-color:#0000ff;
background-image:url('<? echo $array['sfondo']; ?>');
background-attachment:fixed
}
div#post {
position:absolute;
background:#FFFFFF;
border : 4px solid Black;
opacity: 0.80;
align: center;
text-align:center
}
</style>
</head>
<table style="width: 74%; height: 721px" class="style1" align="center">
<tr>
<td class="style2"><center><img src="<? echo $array['logo']; ?>"><h2><? echo $array['nome']; ?></h2><BR><h4><? echo $array['sottotitolo']; ?></h4> </td></tr>
<br>
<td class="style3"><center>
<a href="scrivi_post.php">Scrivi un post</a>
<br>
<?
require('config.ini.php');
include('bbcode.php');
$query = mysql_query("SELECT * FROM post ORDER BY id DESC");
if(!$query){ /*eseguo la query e controllo se va a buon fine ^^*/ die('Errore: non riesco a eseguire la query'); }
while($row=mysql_fetch_array($query))
{
$row['testo'] = htmlspecialchars($row['testo']);
echo "<div id=\"post\" align=\"center\"> ".$row['testo']." </div> <br><br><br> ";
}
?>
<br>
<br>
</td></tr>
<td class="style4 background-color: rgb(255, 255, 255);"><center>
Copiright 2009 <? echo $array['autore'];?> </td></tr>
</table>
</body>
</html>