Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- $HTML = "";
- if($_POST['sname'] == "")
- {
- $HTML .= "<html>
- <head>
- <meta http-equiv='Content-Language' content='en-us'>
- <meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>
- <meta name='GENERATOR' content='Microsoft FrontPage 4.0'>
- <meta name='ProgId' content='FrontPage.Editor.Document'>
- <title>Articulate Installer</title>
- <style type='text/css'>
- #form
- {
- margin-top:40px;
- width:400px;
- }
- </style>
- </head>
- <body>
- <div id='centerit' align='center'>
- <div id='form'>
- <p align='center'><h1>Welcome To Articulate Setup Page</h1>
- <br />
- <form method='POST' action='setup.php'>
- <p align='center'>
- Database Host: <input type='text' value='localhost' name='host'><br /><br />
- Database User: <input name='user' type='text' value='root' > <br /><br />
- Database Pass: <input name='pass' type='password' value='' > <br /><br />
- Database Name: <input type='text' name='db' value='articulate' > <br /><br />
- Site Name: <input type='text' value='Articulate' name='sname' > <br /><br />
- Site Message: <input type='text' value='Articles By The People' name='subname' > <br /><br />
- </p>
- <p align='right'>
- <input type='submit' value='Install'><br />
- </p>
- </form>
- <p align='center'> </p>
- </div>
- </div>
- </body>
- </html>";
- }
- else
- {
- $host = $_POST['host'];
- $user = $_POST['user'];
- $pass = $_POST['pass'];
- $dbname = $_POST['db'];
- $name = $_POST['sname'];
- $sname = $_POST['subname'];
- $sql_end = "
- CREATE TABLE `admin` (
- `username` text,
- `password` text
- ) ENGINE=MyISAM /*!40100 DEFAULT CHARSET=latin1*/;
- INSERT INTO `admin` (`username`, `password`) VALUES
- ('admin','admin');
- CREATE TABLE `articles` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `views` bigint(20) unsigned NOT NULL,
- `title` text,
- `article` longblob,
- UNIQUE KEY `id` (`id`)
- ) ENGINE=MyISAM AUTO_INCREMENT=2;
- INSERT INTO `articles` (`id`, `views`, `title`, `article`) VALUES
- ('1','2','Introduction','Welcome to the Articulate Article System!\r\n\r\nIn this system you allow visitors to your site to post articles about certain subjects. You can use the moderation system that was given to make sure no spam or useless articles are posted. All articles are written in HTML - so monitor the HTML for anything that could be seen as \'harmful\'. With HTML also means it supports javascript, giving your users more control over their articles. It gives a more interactive view toward writing documentation. More Advanced BB Code will be in the future!\r\n\r\n');
- CREATE TABLE `m_articles` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `views` bigint(20) unsigned NOT NULL,
- `title` text,
- `article` longblob,
- UNIQUE KEY `id` (`id`)
- ) ENGINE=MyISAM AUTO_INCREMENT=1;
- ";
- $con = mysql_connect($host,$user,$pass) or mysql_error($con);
- mysql_query("CREATE DATABASE IF NOT EXISTS `{$dbname}`;",$con) or die(mysql_error());
- mysql_select_db($dbname,$con) or die(mysql_error());;
- mysql_query($sql_end,$con) or die(mysql_error());
- mysql_close($con) or die(mysql_error());
- $configfile = fopen("configh.php",'w') or die("fail");
- $configcontent = "
- <?php
- unlink(\"configh.php\");
- //Auto Generated Config File
- //Database Information
- \$host = \"{$host}\"; // This is the host location of your database
- \$user = \"{$user}\"; // This is the username used to connect to your database
- \$pass = \"{$pass}\"; // This is the password user to connect to your database
- \$dbname = \"{$dbname}\"; // The name of the database name
- //Site Information
- \$sitename = \"{$name}\"; //Site Name - such as articulate, because people are allowed to post articles for others to read
- \$sdesc = \"{$sname}\"; // Small Descriptions - its a miniture descriptions of your site. Don't make it too long
- \$configfilled = true;
- ?>";
- fwrite($configfile, $configcontent);
- fclose($configfile);
- $HTML .= "<head>
- <title>Articulate Installer - Complete</title></head> <h2> Articulate Has Been Installed </h2>";
- }
- echo $HTML;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement