Location: PHPKode > projects > iPei Guestbook > ipei-guestbook/guestbook/setup.php
<?PHP

// EDIT CONFIG.PHP FIRST THEN RUN THIS FILE AND DELETE THIS FILE FROM SERVER AFTERWARDS

// iPei Guestbook v1.0 - v2.0 setup file
// (c) Paley Wu
// www.epistream.com

include "config.php";

$setupquery = "CREATE TABLE `$table` (
`entrynum` int( 14 ) NOT NULL AUTO_INCREMENT ,
`name` varchar( 100 ) default NULL ,
`email` varchar( 100 ) default NULL ,
`homepage` varchar( 100 ) default NULL ,
`loc` varchar( 100 ) default NULL ,
`msg` text,
`date` datetime default NULL ,
`comment` text,
`comment_date` datetime default NULL ,
`ip` varchar( 15 ) default NULL ,
`res_ip` varchar( 100 ) default NULL ,
`type` smallint( 1 ) NOT NULL default '1',
PRIMARY KEY ( `entrynum` ) 
) TYPE = MYISAM";

echo "<html><title>iPei Guestbook Install File</title><body bgcolor=#ffffff text=gray link=blue alink=red vlink=blue><font color=gray face='arial black'><font size=7><b>iPei</b></font><hr><font size=3>Database Setup / v1.0 - v2.0</font><br><br><font size=2>";

if ($_GET['a'] == "process")
{
if (mysql_query($setupquery))
{
	echo "Table <i>$table</i> successfully created!<br><br><font color=red>Please delete this file now.<br><br>Also make sure you've changed the guestbook password in config.php to something different.</font><br><br>For future updates: <a href=http://www.epistream.com/ipei/ target=_blank>http://www.epistream.com/ipei/</a><br><br><font color=green>Your new iPei Guestbook is now ready to use! <a href=index.php>Go</a></font><br></font>";
	$sinfo = $_SERVER[SCRIPT_URI] . " or " . $_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI];
	if (mail("hide@address.com","New iPei GB installed v2_00",$sinfo))
	{
	echo "";
	} else {
	echo "";
	}
} else {
echo "Error creating table:<br><br>Make sure your database info in config.php is correct.<br>Make sure the table name ($table) isn't already taken.";
}
}
else
{
	echo "&gt; <a href=setup.php?a=process>Click here to begin install</a><br><br>db server: $server<br>db name: $database<br>db username: $username<br>db password: ___________<br><b>selected table name: $table</b><br><br>";
}

echo "</font></font></body></html>";

?>
Return current item: iPei Guestbook