Location: PHPKode > projects > RecipeNet > install.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>RecipeNet Install Script</title></head>
<body>
<p align="center"><strong>RecipeNet</strong> Alpha Two (0.1.2) Install Script - make sure to read <a href="install_instructions.htm">install_instructions.htm</a> first.</p>
<p>
  <?php
if ($_GET['step'] < "0") {
echo '<form id="form1" name="form1" method="post" action="install.php?step=2">
  <p>Site Name: 
    <input type="text" name="psn" />
</p>
  <p>Admin E-mail address: 
    <input type="text" name="padminemail" />
  </p>
  <p>That\'s it for this version!</p>
  <p>
    <input type="submit" name="Submit" value="Submit" />
</p>
</form>';
}
if ($_GET['step'] == "2") {
$psn=$_POST['psn'];
$padminemail=$_POST['padminemail'];
include 'common.php';
mysql_connect($dbhost,$dbuser,$dbpass);
@mysql_select_db($db) or die( "Unable to select database");
$q1="create table `rn_settings` (    `settid` varchar (255)   NOT NULL ,  `sn` varchar (255)   NOT NULL ,  `email` varchar (255)   NOT NULL ,  `showmail` varchar (255)   NOT NULL ,  `alladd` varchar (1)   NOT NULL ,  `code` varchar (1)   NOT NULL    )";
$q2="INSERT INTO `rn_settings` ( `settid` , `sn` , `email` , `showmail` , `alladd` , `code` )
VALUES (
'e7H78fah9fhj', '$psn', '$padminemail', '', '', ''
)";
$q3="create table `rn_recipes` (    `id` bigint   NOT NULL AUTO_INCREMENT ,  `name` varchar (255)   NOT NULL ,  `submit` varchar (255)   NOT NULL ,  `creator` varchar (255)   NOT NULL ,  `numing` varchar (255)   NOT NULL ,  `numain` varchar (255)   NOT NULL ,  `genre` varchar (255)   NOT NULL ,  `level` varchar (255)   NOT NULL ,  `time` varchar (255)   NOT NULL ,  `ing` longblob   NOT NULL ,  `text` longblob   NOT NULL  , PRIMARY KEY ( `id` )  )";
$q4="insert into `rn_recipes` ( `id`, `name`, `submit`, `creator`, `numing`, `numain`, `genre`, `level`, `time`, `ing`, `text` ) values (  '',  'Welcome to RecipeNet',  'RecipeNet Team',  'RecipeNet Team',  '0',  '0',  'PHP',  'easy',  'none',  'Welcome to RecipeNet!!!',  'Feel free to delete this \'recipe\'' )";
mysql_query($q1);
mysql_query($q2);
mysql_query($q3);
mysql_query($q4);
$subject = "Welcome to RecipeNet";
$body = "Welcome to RecipeNet!  We are very glad that you chose us.  Please note that we are currently in alpha testing and that there probably will be bugs and lack of promised features.  This is normal.  To post bug reports, please <a href=\"http://http://wbhoenig.net/cgi-bin/ikonboard.cgi\">post on our forums.</a>";
$headers = "From: RecipeNet\n";
mail($padminemail,$subject,$body,$headers);
echo 'Installed!  Go to <a href="index.php">index.php</a> to see your setup.  Please delete \'install.php\'.';
} 
echo '</p>
<p>&nbsp;</p>
</body>
</html>';
?>
Return current item: RecipeNet