# connect.php
<style type="text/css">
body {
font-family: Tahoma;
}
.comments#head a {
text-decoration: none;
color: white;
}
.comments#head {
background: url('bg-header.jpg') top;
font-size: 10px;
color: white;
width: 500px;
height: 20px;
padding-left: 6px;
padding-right: 5px;
line-height: 20px;
}
.comments#bericht {
border-left: 1px black solid;
border-right: 1px black solid;
border-bottom: 1px black solid;
height: auto;
font-size: 12px;
min-height: 100px;
width: 504px;
padding-left: 5px;
padding-top: 5px;
}
.comments#clear {
clear: left;
}
</style>
<?php
$server = "localhost";
$gebruiker = "foot";
$wachtwoord = "***";
$database = "gastenboek";
$db = mysql_connect($server, $gebruiker, $wachtwoord) or die ('Kon geen verbinding maken met MySQL.');
mysql_select_db($database) or die ("Kon de database niet vinden.");
?># index.php
<?php
include_once("connect.php");
$query = mysql_query("SELECT naam,email,bericht,datum,tijd,verberg FROM berichten");
while($geg = mysql_fetch_assoc($query)){
if($geg['verberg'] == 0){
$poster = '<a href="mailto:' . $geg['email'] . '">' . $geg['naam'] . '</a>';
} else {
$poster = $geg['naam'];
}
echo "<p><div class=\"comments\" id=\"head\"><b>" . $poster . "</b> " . $geg['datum'] . " @ " . $geg['tijd'] . "<span style=\"float:right\"><a href=\"#\">Quote</a></span></div>
<div class=\"comments\" id=\"bericht\">" . $geg['bericht'] . "</div>
<div class=\"comments\" id=\"clear\"></div></p>";
}
?>In IE ziet het er zo uit: klik
En in FF zo: klik
Waarom verkloot IE mijn website weer?
Die zwarte balk is veel te hoog in IE en de breedthe van bericht is in IE breder dan in FF :S