Im having a problem with my install.php which the code for it is at the bottom. Everything is working on it except that it isnt doing this part
PHP Code:
mysql_query("INSERT INTO `config` (`name`, `value`, `desc`) VALUES
('admin_username', '".$admin_username."', ''),
('admin_password', '".md5($admin_password)."', ''),
('thumb_width', '200', 'The width of a thumbnail in px (pixels).'),
('thumb_height', '200', 'The height of a thumbnail in px (pixels).'),
('show_html', '1', 'Whether HTML should be filtered or not in descriptions, titles etc. (Note: Only use this if you know what you are doing otherwise you may mess up the layout)'),
('per_page', '3', 'The number of projects to show per page.'),
('title', '".$title."', 'The title of your portfolio/site.'),
('about', 'Fill this in yourself.', 'The text on the about page.'),
('email', '".$email."', 'The email to receive the messages from the contact page.');");
install.php
PHP Code:
<?php
$install_page = 1;
require('config.php');
// installer
// fill in the data and run this script
// EDIT DATA BELOW
// enter the username for the admin control panel
$admin_username = 'admin';
// enter the password for the admin control panel
$admin_password = 'password';
// enter the title of the portfolio (this can be changed in the admin panel after installation)
// if the title has quotes in it (' or ") then put a \ infront of them.
// e.g. Bob's Photoshop Portfolio should be Bob\'s Photoshop Portfolio (although you will not see the \)
$title = 'Portfolio';
// enter the email to receive the messages from the contact form (this can be changed after)
$email = 'myemail@email.com';
// NO MORE EDITING REQUIRED
global $mysql_db;
if(mysql_num_rows(mysql_query("SHOW TABLES FROM ".$mysql_db)) == 0) {
mysql_query('CREATE TABLE IF NOT EXISTS `projects` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(40) NOT NULL,
`desc` text NOT NULL,
`url` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1');
mysql_query('CREATE TABLE IF NOT EXISTS `config` (
`name` varchar(20) NOT NULL,
`value` text NOT NULL,
`desc` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;');
mysql_query("INSERT INTO `config` (`name`, `value`, `desc`) VALUES
('admin_username', '".$admin_username."', ''),
('admin_password', '".md5($admin_password)."', ''),
('thumb_width', '200', 'The width of a thumbnail in px (pixels).'),
('thumb_height', '200', 'The height of a thumbnail in px (pixels).'),
('show_html', '1', 'Whether HTML should be filtered or not in descriptions, titles etc. (Note: Only use this if you know what you are doing otherwise you may mess up the layout)'),
('per_page', '3', 'The number of projects to show per page.'),
('title', '".$title."', 'The title of your portfolio/site.'),
('about', 'Fill this in yourself.', 'The text on the about page.'),
('email', '".$email."', 'The email to receive the messages from the contact page.');");
echo 'The script is now installed, you can delete this file (install.php) now.';
}else{
echo 'The script has already been installed, delete this file (install.php) now.';
}