Thursday, 18 February 2016

How to Make a Hit Counter in DreamweaverIn Feburary 2016 18,

In Feburary 2016 18,
Navigate to your Web host's homepage and see if they offer free hit counters. If they don't, go to another Web host that does. Bravenet, for example, offers free hit counters and other Web tools even if you don't have a host account with them (see Resources).
Click the link to the hit counter tool. You may need to register with the Web host in order to download the code, but the registration should be free. If not, look elsewhere. Bravenet's hit counter is free.
Click the button to create a new hit counter. You will be prompted to enter a name for the counter and provide the URL of the page you want to add the counter to.
Choose settings and then the look for your counter.
Select (highlight) and copy the Javascript code the Web host puts on the screen for you.
Open Dreamweaver and open the Web page you want to add the hit counter to.
View the HTML code for your page by clicking the 'CODE' button at the top of the window, then click at the location where you want the counter to appear. Usually counters are placed at the bottom of the page above the closing 'BODY' tag.
Select 'Paste' from the Edit menu and the code for the hit counter will be inserted. Save changes, upload the page to your Web server and view it in your Web browser to test.
Use a Free PHP Script
Use your Web browser to download a free PHP hit counter script from the Internet, such as the one at phpjunkyard.com (see Resources).
Go into your site in Dreamweaver and create a new folder in your local files list called 'counter.'
Place the PHP script and any files that came with it in this folder and read the instructions that come with the script for any special customization steps you need to take. Sometimes this information is on the Web page before you download, or it's a 'readme' file included in the download.
Open the hit counter PHP file in Dreamweaver. Change to 'CODE' view if necessary. There should be very clear instructions from the programmer at the top of the file about what variables you need to customize.
Make any necessary changes to the PHP code following the programmer's instructions. Save and close the file.
Open the Web page you want to add the counter to and save it with the extension .php instead of htm or .html. To run PHP on your page, you need this file extension or the commands will be ignored. View the HTML code on this file.
Click at the location where you want the hit counter to appear (anywhere above the closing 'BODY' tag), and paste in a PHP call to the hit counter file according to the instructions that came with your script. The code would look something like:
</script'>http://www.YOUR_DOMAIN.com/counter/gcount.php'><!--//--></script>.
Add a link back to the programmer's website under the counter (it's the considerate thing to do if you're using someone else's script for free), save changes to the file, then upload the php Web page and the counter folder to your Web server.
View the files on your Web server in Dreamweaver by selecting 'Remote Site' from the top of the site files box on the right. If the instructions for your hit counter script say to change file permissions on any of the script files, right-click the file name and choose 'Set Permissions' from the pop-up menu.
Make the changes to the 'Set Permissions' screen and click 'OK.'
Return to 'Local View' in your site files list and double-check the Web page that will have the hit counter to make sure you have the PHP command correct, then save, upload the file to the server and use your Web browser to view the page and test the hit counter.
In Feburary 2016 18,

No comments:

Post a Comment