Menu
I need a banner free guestbook with no links to other pages, just mine. So if anyone knows of a guestbook script let me know.. maybe i should ask PHP, but i need a guestbook… maybe a generator would be better.
[code=php]<?PHP
$filename = "guestbook.txt"; #CHMOD to 666
$text = "";
if (isset($_POST["submit"])) {
$name = htmlspecialchars($_POST["name"]);
$message = htmlspecialchars($_POST["message"]);
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$value = $message."<br>n<span style="font-family: verdana, arial, sans-serif; font-size: 70%; font-weight: bold;">Posted by $name at $time on $date.</span>n<break>n";
##Write the file##
$fp = fopen ($filename, "a");
if ($fp) {
fwrite ($fp, $value);
fclose ($fp);
}
else {
echo ("Your entry could not be added.");
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Guestbook</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="<?PHP echo $_SERVER["PHP_SELF"]; ?>" method="post">
<p>Your Message:<br>
<textarea name="message" rows="7" cols="50"></textarea><br>
Your Name: <input type="text" name="name">
<input type="submit" name="submit" value="submit"></p>
</form>
<?PHP
$contents = @file($filename) or die("No files in guestbook.");
foreach ($contents as $line_num => $line) {
$text .= $line;
}
$text = split("<break>", $text);
for ($i=0; $i<count($text)-1; $i++) {
echo "<div style="border: gray 1px solid; padding: 5px; font-family: arial, sans-serif; background-color: #eeeeee;">";
echo $text[$i];
echo "</div>";
}
?>
</body>
</html>[/code]
[code=php]##Read old file##
$contents = @file($filename);
$file = "";
foreach ($contents as $line) {
$file .= $line;
}
$post = $file.$value;
##Write the file##
$fp = fopen ($filename, "w");
if ($fp) {
flock($fp, LOCK_EX);
fwrite ($fp, $post);
flock($fp, LOCK_UN);
fclose ($fp);
}
else {
echo ("Your entry could not be added.");
}[/code]
[code=php]<?PHP
$filename = "guestbook.txt"; #CHMOD to 666
$text = "";
if (isset($_POST["submit"])) {
$name = $_POST["name"];
$message = $_POST["message"];
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$value = $message."<br>n<span style="font-family: verdana, arial, sans-serif; font-size: 70%; font-weight: bold;">Posted by $name at $time on $date.</span>n<break>n";
##Read old file##
$contents = @file($filename);
$file = "";
foreach ($contents as $line) {
$file .= $line;
}
$post = $file.$value;
##Write the file##
$fp = fopen ($filename, "w");
if ($fp) {
flock($fp, LOCK_EX);
fwrite ($fp, $post);
flock($fp, LOCK_UN);
fclose ($fp);
}
else {
echo ("Your entry could not be added.");
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Guestbook</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {background-color: rgb(24,24,24)}
</style>
</head>
<body text="#FFFFFF">
<form action="<?PHP echo $_SERVER["PHP_SELF"]; ?>" method="post">
<p>Your Message:<br>
<textarea name="message" rows="7" cols="50"></textarea><br>
Your Name: <input type="text" name="name">
<input type="submit" name="submit" value="submit"></p>
</form>
<?PHP
$contents = @file($filename) or die("No files in guestbook.");
foreach ($contents as $line_num => $line) {
$text .= $line;
}
$text = split("<break>", $text);
for ($i=0; $i<count($text)-1; $i++) {
echo "<div style="border: blue 1px solid; padding: 5px; font-family: arial, sans-serif; background-color: #000000;">";
echo $text[$i];
echo "</div>";
}
?>
</body>
</html>
[/code]
Sign up with Spaceports to get:
unlimited space
up to 5 GB of transfer for your site per month
your own cgi-bin
PHP scripting
MySQL database support
helpful user forums and real-time support chat rooms[/quote]
[i]Originally posted by The Cheat [/i]
[B]check outhttp://www.spaceports.com [/B][/QUOTE]
0.1.9 — BETA 5.19