#native_company# #native_desc#
#native_cta#

EasyGuestbook (No DB needed)

By Mehdi
on February 11, 2001

Version: 1.3

Type: Full Script

Category: Other

License: GNU General Public License

Description: EasyGuestbook is an easy to use guestbook script written in PHP. It supports a smily like 🙂 and converts it to a GIF image. By using an internal stylesheet, you can easily modify it for your Web site. EasyGuestbook is written in German. v1.3 update: Added Smile2Gif support, and censuring of bad words.

make a File in the same Directory called: entry.dat (777)

<html>
<head>
<TITLE>EasyGuestbook 1.3 *smiled*</TITLE>



<META NAME="Author" CONTENT="Mehdi Ayed, Copyright by NemeziZ Design 2k, [email protected]">

<META NAME="Keywords" CONTENT="E-Book, Gstebuch, Guestbook Script, Guestbook, Sign Guestbook">

<META NAME="Description" CONTENT="Contactform written in PHP copyright by NemeziZ">
<STYLE>



FONT,body,td,table {font-family : Arial;font-size : 11px;}

b {

	font-family : Arial;

	font-weight : bold;

}

a,a:hover,.link{font-family: arial;font-size: 8pt;font-color: 66666;}

input, option

	{

		border-color:#3C3C3C;

		border-width:1;

		font-family:tahoma,verdana, Helvetica;

		font-size:11;

		background-color:#eeeeee;

		color:#3C3C3C;

	}

	select

	{

		border-color:#3C3C3C;

		border-width:1;

		font-family:Arial, Helvetica;

		font-size:12px;

		color:#3C3C3C;

		background-color:#FFFFFF;

	}

	textarea

	{

		border-color:#3C3C3C;

		border-width:1;

		overflow:hidden;

		font-family:tahoma,Arial, Helvetica;

		font-size:12;

		color:#000000;

		background-color:#eeeeee;

	}

input.submit {

   background-color: #e0e0e0;

   font-weight: bold;

  }

  A{

	color : #0066CC;

	text-decoration : none;

}

  

  A:visited {

	color : Gray;

}

  A:hover {

	color : #0099FF;

}



</STYLE>
</head>



<body bgcolor="#FFFFFF" leftmargin="0" topmargin="30" marginwidth="0" marginheight="0">

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#666666">   

   <CENTER>
<FONT color="#ffffff">
   <B>Easyguestbook 1.3 *smiled*</B>

   </FONT>

   </CENTER></td>
  </tr>
  <tr>
  <td height="50"></td>
  </tr>
  <tr>
    <td><form action="<?PHP_SELF?>" method="post">
      <table width="498" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td>Name</td>
          <td> 
            <input name="name" size=30 value="">
          </td>
        </tr>
        <tr> 
          <td>E-Mail</td>
          <td> 
            <input name="email" size=30 value="">
          </td>
        </tr>
        <tr> 
          <td>Homepage:</td>
          <td> 
            <input name="url" size=30 value="http://">
          </td>
        </tr>
        <tr> 
          <td>Company:</td>
          <td> 
            <input name="company" size=30 value="">
          </td>
        </tr>
        <tr> 
          <td valign="top">Message:</td>
          <td> 
            <textarea name="message" cols=50 rows=10 wrap=soft></textarea>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <input type="hidden" value="ok" name="send_status">
          </td>
          <td>
            <input type="submit" value="Sign Guestbook" name="submit">
            <input type="submit" value="View Guestbook" name="view_guestbook">
          </td>
        </tr>
      </table></form>
    </td>
  </tr>
  <tr>
    <td> <center>
      <?



			 







	/******************************************************************/

	if ($name == "" || $email == "" || $company == "" || $message == "")

	   {

			 	echo "Please make an entry";

				for ($i=0; $i<3; $i++)

				{

				echo ".";

				sleep(1);

				flush();

				}

		$filesize = filesize("entry.dat"); 

		$file = fopen("entry.dat","r");

		$buffer = fread($file,$filesize);

		/********************** SMILE PARSING **(beta)********************/
		$smile_parse1 = str_replace(":-)","<IMG SRC=smile.gif border="0">",$buffer);
		$smile_parse2 = str_replace(":-P","<IMG SRC=tongue.gif border="0">",$smile_parse1);
		$smile_parse3 = str_replace(":-p","<IMG SRC=tongue.gif border="0">",$smile_parse2);
		$smile_parse4 = str_replace(":P","<IMG SRC=tongue.gif border="0">",$smile_parse3);
		$smile_parse5 = str_replace(":)","<IMG SRC=smile.gif border="0">",$smile_parse4);
		$smile_parse6 = str_replace(":-(","<IMG SRC=notsmile.gif border="0">",$smile_parse5);
		$smile_parse7 = str_replace(":(","<IMG SRC=notsmile.gif border="0">",$smile_parse6);
		$smile_parse8 = str_replace(":-o","<IMG SRC=osmile.gif border="0">",$smile_parse7);
		$smile_parse9 = str_replace(";-)","<IMG SRC=zwinker.gif border="0">",$smile_parse8);
		$smile_parse10 = str_replace(";)","<IMG SRC=zwinker.gif border="0">",$smile_parse9);

		/********************** CENSURES **************************/
		$smile_parse11 = str_replace("sex","<IMG SRC=censured.gif border="0">",$smile_parse10);
		$smile_parse12 = str_replace("shit","<IMG SRC=censured.gif border="0">",$smile_parse11);
		$smile_parse13 = str_replace("fuck","<IMG SRC=censured.gif border="0">",$smile_parse12);
		$smile_parse14 = str_replace("asshole","<IMG SRC=censured.gif border="0">",$smile_parse13);
		$smile_parse15 = str_replace("microsoft","<IMG SRC=censured.gif border="0">",$smile_parse14);
		$smile_parse16 = str_replace("bitch","<IMG SRC=censured.gif border="0">",$smile_parse15);

		$buffer_parsed = str_replace(":-x","<IMG SRC=xsmile.gif border="0">",$smile_parse16);
		echo "$buffer_parsed";

		fclose($file);

	   }

	else if ($send_status == "ok")

	   		{



			/********* GET VARIABLE **********/

			 $filesize = filesize("entry.dat"); 

			 $file = fopen("entry.dat","r");

			 $buffer = fread($file,$filesize);

			 $buffer_parsed = str_replace(":-)","<IMG SRC=smile.gif border=0",$buffer);

			 fclose($file);

$today = getdate(); 
$month = $today[month]; 
$mday = $today[mday]; 
$year = $today[year]; 
$zeituhr = "$month $mday, $year";







			/******* WRITING MESSAGE TO FILE ****/

			 $file = fopen("entry.dat","w");

			 $parsed_message = strip_tags($message,"<a>,<i>");
			 $parsed_message_br = str_replace("n","<br>",$parsed_message); 
			 $today = date( "Ymd", time() );
			 $message_table ="<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" bgcolor=EEEEEE width="500"><TD bg="top.gif" colspan="2"><IMG SRC="top.gif" width="100%" height="5" border="0"></TD></TR><TR><TD align="right" colspan="2"><i>$zeituhr</i></TD></TR><TR><TR><TD width="30%"><B>Name:</B></TD><TD>$name</TD></TR><TR><TD><B>E-Mail:</B></TD><TD><A HREF="mailto:$email">$email</A></TD></TR><TR><TD><B>Homepage:</B></TD><TD><A HREF="$url" target="_blank">$url</A></TD></TR><TR><TD><B>Company:</B></TD><TD>$company</TD></TR><TR><TD valign="top" colspan="1"><B>Message:</B></TD><TD>$parsed_message_br</TD></TR><TR><TD bg="bottom.gif" colspan="2"><IMG SRC="bottom.gif" width="100%" height="13" border="0"></TD></TR></TABLE>";

 			 fputs($file,"$message_table n $buffer");

			 fclose($file);

		

			}

	else if ($view_guestbook == "View Guestbook"){

			/************ READING OUT **************/

			 $filesize = filesize("entry.dat"); 

			 $file = fopen("entry.dat","r");

			 $buffer = fread($file,$filesize);

			 $buffer_parsed = str_replace(":-)","<IMG SRC=smile.gif border=0",$buffer);

			 echo "$buffer_parsed";

			 fclose($file);

			/************************************/

		}

	$copyright = "   <!-- PLEASE DO NOT REMOVE THIS TAG ----------------------------------------->
	
   <span class="link">Easyguestbook 1.3 *smiled*, Copyright by <A HREF="http://www.NemeziZ.net" target="_blank">NemeziZ</A> &copy;
	
   <!-- PLEASE DO NOT REMOVE THIS TAG ----------------------------------------->";

	?></center>
    </td>
  </tr>
    </tr>
  <tr>
  <td height="50"></td>
  </tr>
  <tr>
    <td bgcolor="#666666">
   <CENTER>
        <FONT color="#ffffff"><?echo"$copyright"?></FONT> 
      </CENTER></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>