Location: PHPKode > projects > Christmas Wishlist and Registry > install/install2.php
<?php
//N7 Xmas Wish List V.1.0.1
//Another free product brought to you by the N7 Design group.
//The N7 Design group is a partner of Southern Comp Solutions LLC
//(http://www.southerncompsolutions.com
//The N7 Design group's only mission and goal is to provide open source programs that anyone can use
//If you like this project or support the open source movement please help out by donating to our
//cause paypal (hide@address.com) or from our sourceforge project page (all donations on the
//sourceforge project page include a 25% donation to sourceforge.)

$file = "../config.inc.php";   
if (!$file_handle = fopen($file,"w")) { echo "Cannot open file, check the file permissions."; }  

$data0 .= '<?';
$data1 = "// DB Settings";
$data2 .= '$dbname = \'' . $dbname1 .'\';';
$data3 .= '$dbuser = \'' . $dbuser1 .'\';';
$data4 .= '$dbpassword = \'' . $dbpass1 .'\';';
$data5 .= '$dbhost = \'' . $dbhost1 .'\';';
$data6 = "// User settings set userids and passwords for the people that the list will include.";
$data7 .= '$user1 = \'' . $user11 .'\';';
$data8 .= '$pass1 = \'' . $pass11 .'\';';
$data9 .= '$user2 = \'' . $user21 .'\';';
$data10 .= '$pass2 = \'' . $pass21 .'\';';
$data11 .= '$user3 = \'' . $user31 .'\';';
$data12 .= '$pass3 = \'' . $pass31 .'\';';
$data13 .= '$user4 = \'' . $user41 .'\';';
$data14 .= '$pass4 = \'' . $pass41 .'\';';
$data15 .= '$registry = \'' . $registry1 .'\';';
$data16 = "// Misc Settings";
$data17 .= '$title = \'' . $title1 .'\';';
$data18 .= '$header = \'' . $header1 .'\';';
$data19 .= '?>';



$data = "$data0\n$data1\n$data2\n$data3\n$data4\n$data5\n$data6\n$data7\n$data8\n$data9\n$data10\n$data11\n$data12\n$data13\n$data14\n$data15\n$data16\n$data17\n$data18\n$data19\n";

if (!fwrite($file_handle, $data)) { echo "Cannot write to file"; }
echo "Config file successfully written.\n<br>";
fclose($file_handle);


$dblink = MYSQL_CONNECT($dbhost1, $dbuser1, $dbpass1) OR DIE("<b>There is an error double check your database information and try again.</b>");
@mysql_select_db($dbname1) or die( "Unable to select database ".$dbName);
//create table

$sql = "CREATE TABLE xmas_list(
id int(10) NOT NULL auto_increment,
item VARCHAR(255) NOT NULL,
purchased VARCHAR(255) NOT NULL default 'No',
name VARCHAR(255) NOT NULL,
who VARCHAR(255) NOT NULL,
PRIMARY KEY(id))"; 
$result = MYSQL_QUERY($sql) or DIE (mysql_error());

echo "Table imported into database.<br>";
echo "<h3>Be sure to Delete the install directory and make sure config.inc.php is not world writeable \"chmod 755\"</h3>";

?>
Return current item: Christmas Wishlist and Registry