Location: PHPKode > projects > GBook > install.php
<?php
// GBook made by Racin Nygaard. If you have any questions please ask them on irc (darkking @ Efnet)
// Or email me at: hide@address.com :)

if (!isset($_POST["database1"]) || !$_POST["database1"] || !isset($_POST["username1"]) || !$_POST["username1"] || 
!isset($_POST["password1"]) || !$_POST["password1"] || 
!isset($_POST["hostname1"]) || !$_POST["hostname1"] || !isset($_POST["adminusername1"]) || !$_POST["adminpassword1"] || 
!isset($_POST["tableban"]) || !$_POST["tableban"] || !isset($_POST["tabledesign"]) || !$_POST["tabledesign"])
{
echo "Please fill out everything!";
}
else
{
$pass = md5($_POST["adminpassword1"]);
$filename = "config.php";
$fp = fopen ($filename, "a");
fwrite($fp, "// Edit this part if you wish to config GBook manually
\$database='{$_POST['database1']}'; // change to your own
\$username='{$_POST['username1']}'; // change to your own
\$password='{$_POST['password1']}'; // change to your own
\$bantable='{$_POST['tableban']}'; // change to your own
\$designtable='{$_POST['tabledesign']}'; // change to your own
\$table='{$_POST['table1']}'; // change to your own
\$hostname='{$_POST['hostname1']}'; // change to your own. 'localhost' in most cases
\$adminusername='{$_POST['adminusername1']}'; // change to whatever you prefer
\$adminpassword='{$pass}'; // change to whatever you prefer
\$link = mysql_connect(\$hostname,\$username,\$password) or die ('Unable to connect to the mySQL server');
mysql_select_db(\$database,\$link) or die ('Could not select Database');
?>");
fclose ($fp);

echo "<form method=\"post\" action=\"install2.php\">
<input type=\"hidden\" name=\"hehe\" value=\"skillz0rz\">
<input type=\"submit\" value=\"move on..\">
</form>";
}
?>
Return current item: GBook