Da ist mal meine gast.php:
[php]
Zimmermann Daniel
<div id="haupt">
<div id="header" style="background-image: URL(slices/Bilder/header.png); width: 800px; height: 65px;">
</div>
<div id="menu" style="background-image: URL(slices/Bilder/menu.png);">
<div id="button">
<a href="index.html" onMouseover="austausch.src='slices/Bilder/homeeffekt.png';" onMouseout="austausch.src='slices/Bilder/home.png'"><img src="slices/Bilder/home.png" border="0" name="austausch" alt="home"></a><br>
<a href="lebenslauf.html" onMouseover="austausch2.src='slices/Bilder/lebenslaufeffekt.png';" onMouseout="austausch2.src='slices/Bilder/lebenslauf.png'"><img src="slices/Bilder/lebenslauf.png" border="0" name="austausch2" alt="lebenslauf"></a><br>
<a href="gast.php">Gast</a>
</div>
</div>
<div id="main" style="background-image: URL(slices/Bilder/main.png);">
<h3>Gästebuch</h3>
<div id="gast">
<?php
error_reporting(E_ALL);
define('MYSQL_HOST', 'localhost');
define('MYSQL_USER', 'xxx');
define('MYSQL_PASS', 'xxx');
define('MYSQL_DATABASE', 'xxx');
mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) OR
die("Es konnte keine Verbindung aufgebaut werden\n".mysql_error());
mysql_select_db(MYSQL_DATABASE) OR
die("Konnte ".MYSQL_DATABASE." nicht benutzen ".mysql_error());
$name="";
$mail="";
$mitteilung="";
$gesendet=false;
echo'
<form action="gast.php" METHOD="POST">
<div id="textfeld">
Name:<br>
<input type="text" name="name"></input><br>
Email:<br>
<input type="text" name="mail"></input><br>
Mitteilung:<br>
<textarea name="mitteilung" rows="4" cols="16"></textarea><br>
<input type="submit" value="senden"></input>
</div>
</form>
';
if(isset($_POST["name"]) && isset($_POST["mail"]) && isset($_POST["mitteilung"])){
$user = $_POST["name"];
$email = $_POST["mail"];
$msg = $_POST["mitteilung"];
if(preg_match('#[<>&\/\\\]#', $user) || preg_match('#[<>&\/\\\]#', $email) || preg_match('#[<>&\/\\\]#', $msg)){
echo "Keine Sonderzeichen";
echo "<a href='gast.php'>nochmal</a>";
die();
}
else{ // ip adresse vergleichen und schaun ob er innerhalb von 10 minuten gepostet hat
if($user != null && $email != null && $msg != null){
$datum = date("Y.m.d - H:i");
$ipadresse ="$REMOTE_ADDR";
$ergebnis = "";
$result = mysql_query("SELECT timestamp FROM gastebuch WHERE ip = '$ipadresse' ORDER BY TIMESTAMP DESC LIMIT 1");
if(mysql_num_rows($result) == 0){ // wenn
$times = time();
mysql_query($eintrag = "INSERT INTO gastebuch(name, mail, mitteilung, datum, ip, timestamp) VALUES ('$user', '$email', '$msg', '$datum','$ipadresse', '$times')");
}
else{
$ergebnis = mysql_result($result,0,0);
if($ergebnis + 600 > time()){
echo "Du kannst erst in 10 Minuten wieder posten!";
}
else{
$times = time();
mysql_query($eintrag = "INSERT INTO gastebuch(name, mail, mitteilung, datum, ip, timestamp) VALUES ('$user', '$email', '$msg', '$datum','$ipadresse', '$times')");
}
}
}
else{
echo "Felder leer";
echo "<a href='gast.php'>nochmal</a>";
}
}
}
$count = 0;
$tabelle = mysql_query("SELECT name, mail, mitteilung, datum, ip FROM gastebuch ORDER BY datum DESC") OR die(mysql_error());
echo '<div id="eintrage">';
while($row = mysql_fetch_assoc($tabelle)){
echo "<b>Datum:</b> ".$row["datum"]."<br>";
echo "<b>Name:</b> ".$row["name"]."<br>";
echo "<b>Email:</b> "."<a href=mailto:".$row['mail'].">".$row['mail']."</a><br>";
echo "<b>Mitteilung:</b><br>".$row["mitteilung"]."<br>";
$count++;
}
echo'</div>';
if($count > 3){
echo'
<div id="weiter">
<a href="gast.php">nächste Seite</a>
</div>
';
}
?>
</div>
</div>
<div id="footer" style="background-image: URL(slices/Bilder/footer.png); width: 800px; height: 59px;">
</div>
</div>
<div id="unten">
<a href="http://www.daniel-zimmermann.at" class="p1">2008, Zimmermann Daniel | www.daniel-zimmermann.at</a> <a href="impressum.html" class="p2">Impressum</a>
</div>
</body>
[/php]Da meine CSS:
[HTML]
#haupt{
margin: 0 auto;
width: 800px;
height: 600px;
margin-top: 20px;
border: 2px solid gray;
}
#header{
position: relative;
}
#menu{
position: relative;
height: 476px;
width: 119px;
float: left;
}
#main{
height: 476px;
width: 681px;
margin-left: 119px;
margin-top:0px;
}
#home{
margin-left: 210px;
margin-right: 20px;
margin-top: 210px;
position: fixed;
font-family: verdana;
font-size: 12px;
color: black;
font-weight: bold;
}
#button{
margin-top: 150px;
margin-left: 30px;
}
#footer{
position: relative;
margin-top: 0px;
margin-left: 0px;
}
#lebenslauf{
position: fixed;
margin-left: 130px;
margin-top: 80px;
font-family: verdana;
font-size: 12px;
color: black;
text-align: justify;
}
a.p1{
float: left;
text-decoration: none;
}
a.p2{
text-decoration: none;
}
h3{
margin-top: 10px;
position: absolute;
margin-left: 130px;
font-family: verdana;
font-size: 16px;
}
#unten{
margin: 0 auto;
margin-top: 2px;
width: 800px;
text-align: right;
font-family: verdana;
font-size: 10px;
}
#impress{
position: absolute;
margin-top: 100px;
margin-left: 130px;
font-family: verdana;
font-size: 12px;
text-align: justify;
}
#gast{
position: absolute;
}
#textfeld{
position: ;
margin-top: 120px;
margin-left: 130px;
text-align: justify;
}
#eintrage{
width: 250px;
height: 200px;
position: absolute;
margin-top: 50px;
margin-left: 350px;
text-align: justify;
}
a{
text-decoration: none;
}
a:link{color: black;}
a:visited{color: gray;}
a:hover{color: #BA9015;}
a:active{color: #BA9015;}
a.p1:link{color: #89867B; }
a.p2:link{color: #89867B; }
a.p1:visited { color: black;}
a.p2:visited{ color: black;}
a.p1:hover { color:#CDCC62;}
a.p1:active { color:#CDCC62;}
a.p2:hover { color:#CDCC62;}
a.p2:active { color:#CDCC62;}[/HTML]
Und Hp Link ist folgender: Zimmermann Daniel