The easiest way would be to install phpMyAdmin on your server and run the following queries:
Code:
DROP TABLE IF EXISTS `poll`;
CREATE TABLE `poll` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(50) default NULL,
`question` varchar(255) default NULL,
`bgcolor` varchar(20) default NULL,
`fontsize` varchar(10) default NULL,
`font` varchar(50) default NULL,
`fontcolor` varchar(20) default NULL,
`orientation` varchar(100) default NULL,
`tbgcolor` varchar(20) default NULL,
`tfontsize` varchar(10) default NULL,
`tfontcolor` varchar(20) default NULL,
`tfont` varchar(50) default NULL,
`votes` int(11) default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Simple Poll';
Code:
DROP TABLE IF EXISTS `choices`;
CREATE TABLE `choices` (
`id` int(11) NOT NULL auto_increment,
`pollid` int(11) NOT NULL default '0',
`choice` varchar(255) default NULL,
`barcolor` varchar(20) default NULL,
`votes` int(11) default '0',
PRIMARY KEY (`id`),
KEY `pollid` (`pollid`)
) TYPE=MyISAM COMMENT='Simple Poll';
Open up admin/config.inc and change the values to reflect your server and database.
Code:
<?
define(hostname,"localhost"); // mysql server host name
define(dbname,"FreePhpNet"); // mysql database name
define(username,""); // mysql user name
define(password,""); // mysql password
define(templatedir,"/home/public_html/simplepoll/templates/"); // directory where templates are located (must end foward slash)
define(simplepollurl,"/simplepoll/"); // url to the script main directory (must end foward slash)
?>
(Apache servers only from now on) To limit access to your admin directory, create a file called .htaccess and put in the poll's directory:
Code:
AuthUserFile /home/public_html/simplepoll/.htpasswd
AuthGroupFile /dev/null
AuthName Simple Poll
AuthType Basic
require valid-user
Then, create a file called .htpasswd with the contents in the following format:
Code:
username:hash_of_password
For example, if your username is "toco004" and your password is "foo," it would look like this:
Code:
toco004:38KOjZwqQSySc
If you wanted another person named "haxor41789" to access it with the password "bar," it would look like this:
Code:
toco004:38KOjZwqQSySc
haxor41789:335Bm7iLPDgIs
Here is a tool for creating .htpasswd usernames and passwords.
Hope this helps.
Bookmarks