How to make a hit counter in dreamweaver

Written by katelyn kelley
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to make a hit counter in dreamweaver
Bravenet Free Web Tools

Because Dreamwaver makes it so easy to work with HTML code and scripts, even if you're a novice Web designer, adding a hit counter to your Web page is not difficult to do. There are a couple ways to make a hit counter. The easiest way is to get code for a free hit counter tool from your Web host and paste it onto your Web page. A second way is to create a PHP Web page and use a PHP script. The PHP method is a little more complicated, but you don't have to be a programmer to get it to work.

Skill level:
Moderate

Other People Are Reading

Instructions

  1. 1

    Navigate to your Web host's home page 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).

    How to make a hit counter in dreamweaver
    Bravenet Free Web Tools
  2. 2

    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.

    How to make a hit counter in dreamweaver
    Registration Screen
  3. 3

    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.

  4. 4

    Choose settings and then the look for your counter.

    How to make a hit counter in dreamweaver
    Hit Counter Styles
  5. 5

    Select (highlight) and copy the JavaScript code the Web host puts on the screen for you.

    How to make a hit counter in dreamweaver
    Hit Counter Code Example
  6. 6

    Open Dreamweaver and open the Web page you want to add the hit counter to.

  7. 7

    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.

  8. 8

    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.

    How to make a hit counter in dreamweaver
    Hit Counter on Web Page
  1. 1

    Use your Web browser to download a free PHP hit counter script from the Internet, such as the one at phpjunkyard.com (see Resources).

  2. 2

    Go into your site in Dreamweaver and create a new folder in your local files list called "counter."

    How to make a hit counter in dreamweaver
    Counter Folder in Dreamweaver
  3. 3

    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 customisation 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.

  4. 4

    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 customise.

    How to make a hit counter in dreamweaver
    PHP Script Example
  5. 5

    Make any necessary changes to the PHP code following the programmer's instructions. Save and close the file.

  6. 6

    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.

  7. 7

    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 language="JavaScript" src="http://www.YOUR_DOMAIN.com/counter/gcount.php"><!--//--></script>.

  8. 8

    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.

  9. 9

    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.

    How to make a hit counter in dreamweaver
    Set Permissions Command in Dreamweaver
  10. 10

    Make the changes to the "Set Permissions" screen and click "OK."

  11. 11

    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.

Tips and warnings

  • There are free hit counter service companies that offer code to copy and paste to your Web pages (like the Web-hosting example above). However, if the company goes out of business, the service will end. Because Web-hosting companies offer many services (not just hit counters), they tend to stay in business longer.
  • You can also use a Perl CGI script for a hit counter. They work similarly to the PHP script mentioned here, and are free to download on the Internet.
  • Free hit counters from Web hosts may include graphics advertising the host company, but that's a small concession for something you're getting for free.
  • Using a PHP hit counter will only work if your Web server has PHP installed. Most Web-hosting companies do, but Internet service providers that give you a free Web account as part of your connection package may not.
  • When using the PHP script, you may need to update some links on your site since the name of your Web page will change when you add the .php extension to the file name.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.