Der Code ist fast der gleiche:
<? if(!isset($site)) { ?>
<title>[ message.box | leave.a.message ]</title>
</head>
<body background="img/faded-Background.jpg" text="#fff">
<center>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="5" cellpadding="0">
<form action="msgbox.php?site=thankyou" method="post">
<tr>
<td width="20%"><p align="right">Name:</p></td>
<td width="80%"><p align="left"><input type="text" name="name" size="20" maxlength="255" onblur="this.style.backgroundColor='#FFFFFF'" onfocus="this.style.backgroundColor='#FFFF99'"></p></td>
</tr>
<tr>
<td width="20%"><p align="right">Email:</p></td>
<td width="80%"><p align="left"><input type="Text" name="email" size="20" maxlength="255" onblur="this.style.backgroundColor='#FFFFFF'" onfocus="this.style.backgroundColor='#FFFF99'"></p></td>
</tr>
<tr>
<td width="20%"><p align="right">Comment:</p></td>
<td width="80%"><p align="left"><input type="text" name="comment" size="20" maxlength="255" onblur="this.style.backgroundColor='#FFFFFF'" onfocus="this.style.backgroundColor='#FFFF99'"></p></td>
</tr>
<tr>
<td width="20%"></td>
<td width="80%"><p align="left"><input type="submit" name="abschicken" value="shout" class="button"></p></td>
</tr>
</form>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellspacing="5" cellpadding="0">
<tr>
<td>
<?php
$filename="message.txt";
if (file_exists($filename)) {
$fp = fopen($filename,"r");
for ($i=0;$i<20;$i++) {
while(!feof($fp)) {
$zeile=fgets($fp,32000);
list($name,$datum,$email,$comment)=explode("|",$zeile);
$comment = preg_replace("/([A-Za-z0-9.-\]{2,})(@)([A-Za-z0-9.-\]{3,})(.)([A-Za-z]{2,3})\b/","<a href="mailto:\0">\0</a>",$comment);
$comment = preg_replace("/(http://)([A-Za-z0-9.-\/]{3,})(.)([A-Za-z]{2,3})([A-Za-z0-9.-\/]{0,})\b/","<a href="\0" target="_blank">\0</a>",$comment);
if (!$email) {
echo $name." wrote @ ".$datum."<br>".$comment."<br><br>";
} else {
echo "<a href="mailto:".$email."">".$name."</a> wrote @ ".$datum."<br>".$comment."<br><br>";
}
}
}
fclose($fp);
} else {
echo "<p align="center" style="margin-top: 20"><b>no entries yet</b></p>";
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<? } ?>
<? if(isset($site)) { ?>
<? if($site == "thankyou") { ?>
<meta http-equiv="refresh" content="5;URL=msgbox.php"> <- Nur hier würde ich index.htm angeben.
<title>[ message.box | thank.you ]</title>
</head>
<body bgcolor="#FFCC33" text="#000000">
<center>
<table width="175" border="0" cellspacing="2" cellpadding="0">
<tr>
<td>
<?php
$filename="message.txt";
if(isset($abschicken)) {
$fpn=@fopen($filename.".tmp","w");
if($fpn<=0) {
?>
Fehler
<?php
}
$comment = str_replace("|","",$comment);
$comment = htmlspecialchars($comment);
$comment = ereg_replace("c:/con/con", "[unallowed string]", $comment);
$email = str_replace("|","",$email);
$email = htmlspecialchars($email);
$email = ereg_replace("c:/con/con", "[unallowed string]", $email);
$name = str_replace("|","",$name);
$name = htmlspecialchars($name);
$name = ereg_replace("c:/con/con", "[unallowed string]", $name);
$datum=date("j.n.y, H:i");
$comment=htmlspecialchars($comment);
$datum=date("j.n.y, H:i");
if(file_exists($filename)) {
$eintrag= "$name|$datum|$email|$comment\n";
} else {
$eintrag= "$name|$datum|$email|$comment";
}
fputs($fpn,$eintrag);
if(!file_exists($filename)) {
$fp=fopen($filename,"w");
fclose($fp);
}
unset($fp);
$fp=@fopen($filename,"r");
if($fp<=0) {
?>
Fehler
<?php
}
while(!feof($fp)) {
$zeile=fgets($fp,32000);
fputs($fpn,$zeile);
}
fclose($fp);
fclose($fpn);
unlink($filename);
rename($filename.".tmp",$filename);
echo "<p align="center" style="margin-top: 20"><b>thanks for your entrie</b></p>";
echo "<p align="center">you will be redirected back ...</p>";
}
?>
</td>
</tr>
</table>
</center>
<? } ?>
<? } ?>
Bei dem meta refresh hab ich dann index.htm angegeben, also die Datei in die ich diesen Php Script eingefügt habe. Aber trotzdem springt er zu msgbox.php
Ursprünglich hab ich über einen iframe das eingebunden, aber da das ja nicht unbedingt eine gute Lösung ist wollte ich es eben richtig machen :D