har fundet en sød lille gæstebog, men der er noget galt med koden
og jeg er ikke den største haj så kan ikke regne den ud. kan nogen evt hjælpe mig.....TAKKKK<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Gæstebog</title>
</head>
<body bgcolor='#000000'>
<center>
<?
#########################################################################################
################# MINI mark comment taker ########################
##### this script allows people to leave a short message on your site ############
################# created by Doug Rodgers #################################
######################## drwebstuff.com ##############################################
#########################################################################################
## the only thing you will have to do is chmod the db.txt file to 777 on a UNIX server ##
## and change the edit variables below ##
######## the db.txt file will be created for you when the minmark.php file is opened ##
#########################################################################################
//start edit
$mailNotification = 0; // 1 if you want to be notified of new entry 0 if not
$emailAddress = "ntaliehenning@hotmail.com"; //chang to your email address
$max_results = 4; /*number of postings displayed per page -- if you set this to 0 and
mailNotification to 1 the script becomes a comment mailer only*/
$websiteName = "Ski-dullerne"; //your website name
$messageLength = 150; //how many characters are allowed to be submitted from form
//end edit
?>
<div id="Object" STYLE="border:dashed 2px #000;padding: 20px; background-color: #990000; font-family serif;font-size:12PX;color:#fff;font-weight:700;width:220px;">
<img src="tulle.jpg">
<font style="font-size:12px;color:#eee;" face=arial><br /><center><?echo $websiteName?>Velkomme til skidullernes gæstebog<br />(max 150 characters)</center></font>
<br />
<form action="comment_taker.php" method="post">
<textarea name='comments' cols='20' rows='7'></textarea>
<input type="hidden" name="hr" value="<hr width=180 align=center>">
<input type="submit" name="submit" value="Send!">
</form>
<?
error_reporting(E_ERROR);
if ( isset($_POST["comments"]))
{
if ($HTTP_POST_VARS['comments'] == ''){
echo "<b>please enter a comment!</b><br /><br />";
}
else {
$lines = file("comments.txt");
$totalresults = sizeof($lines);
$totalresults = "Entry--".$totalresults." --";
$comments = $_POST["comments"];
$hr = $_POST["hr"];
if ( strlen($comments) >$messageLength){
echo "sorry max $messageLength character<br />";
}
else{
$time = date("d-m-Y H:i:s");
$removedtags = strip_tags($comments);
$wrap = wordwrap($removedtags, 20, "\n", 1);
$replaced = eregi_replace("[\n)]+"," ",$wrap);
$fp = fopen('comments.txt','a+');
if (!$fp) {echo '<p>ERROR! Unable to open file.</p>'; exit;}
fputs($fp,"/$totalresults/$replaced/$time/$hr/\n",1024);
fclose($fp);//close file
}
}
}
if(!isset($_GET['page'])){
$page = 1;
} else {
$page = $_GET['page'];
}
$from = (($page * $max_results) - $max_results);
$resultsonpage = $from + $max_results;
$lines = file("comments.txt");
$result = array_reverse ($lines);
$totalresults = sizeof($result);
$total_pages = ceil($totalresults / $max_results);
if ($totalresults > 0){
for($i = $from; $i <= $resultsonpage-1; $i++){
echo "<table cellspacing=0 cellpadding=0 border=0><tr>";
$linenumber = $result[$i];
list ($start,$id,$comments,$date,$hr,$end) = split ('[/]', $linenumber);
echo "<td><font style=\"font-size:9px;color:#990000;\" face=arial>$id ".$date."</font><br /><font style=\"font-size:12px;color:#ffc;\" face=arial>". $comments." $reply<center>$hr</center></font></td>";
}
echo "</tr></table>";
echo "<center>Se tidligere beskeder<br />";
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\"><font style=\"font-size:11px;color:#990000;\" face=arial><<</font></a> ";
}
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "$i ";
} else {
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\"><font style=\"font-size:11px;color:#990000;\" face=arial>$i</font></a> ";
}
}
// Build Next Link
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\"><font style=\"font-size:11px;color:#ffffcc;\" face=arial>>></font></a>";
}
}
else echo "<font style=\"font-size:11px;color:#ffc;\" face=arial>Add your comment</font>";
if ($mailNotification == 1 and $fp){
$to = $emailAddress;
$subject = "Gæstebog";
$message = "<center>Someone has signed your comments page at $websiteName<br> --- THE MESSAGE IS ---</center><br><br>$replaced <br><br> time and date of message $time";
$sendjoke= mail($to, $subject, $message, "MIME-Version: 1.0\r\n"."Content-type: text/html; charset=iso-8859-1\r\n"."From: $websiteName@{$_SERVER['SERVER_NAME']}\r\n" . "Reply-To: $websiteName@{$_SERVER['SERVER_NAME']}\r\n" . "X-Mailer: PHP/");
}
?>
<br /><br />
</div>
</center>
</body>
</html>