Counter for individual posts of Blogger - PHP / MYSQL


After many requests by e - mail I decided to create this tutorial to explain how to do this counter that I have here on the Blog . I tried to make it available for everyone , plus my server did not support this feat , so I will teach you install it on your own server so you can enjoy it better. The counter is basically done in " PHP " and uses a " database" , if you have doubts about the possibility of doing this in your hosting ask you contact their support and check it . I want to remember that this script credits go to the creator Ashu . See below how to :


1 - Download the script to your computer and extract it to a folder . The extracted file will have the php extension.

2 - Go to the control panel of your hosting , and create a new database named " bloggercounter " without quotes . Now go to the page and click on phpMyAdmin database created , and then click the SQL icon and enter the following code :

CREATE TABLE `bloggercounter`.`counter` (

`SN` BIGINT NOT NULL AUTO_INCREMENT ,

`name` VARCHAR( 1000 ) NOT NULL ,

`hit` BIGINT NOT NULL DEFAULT '1',

PRIMARY KEY ( `SN` )

) ENGINE = MYISAM
Click "Run".

3 - Open with notepad the file counter.php downloaded in the "Step 1" and edit the following lines:

$username = "YOUR-USERNAME"; // Enter Your Username and Password Here
$password = 'YOUR-PASSWORD'; // Enter Your Username and Password Here
$database = 'YOUR-COUNTER-DATABASE'; //Enter Your Database Name Here
$table = "YOUR-COUNTER-TABLE"; //Enter Your Counter Table Name Here
After finding the lines, edit the words in red with your hosting login, edit the words in orange with the password of your hosting, edit the words in green putting the following information: bloggercounter seen in step 2. In the passage in blue enter the following: counter. Save the file with the changes.

4 - Send the file to your hosting. Now insert the link to the file in the following excerpt:

<script src="http://sua-hospedagem/counter.php" type="text/javascript"></script>
5 - Now just follow this tutorial created here on the blog, just remembering to replace the words appearing there for this that you created in step 4.