PHP Text Hit Counter

In case you have problems with some other PHPJunkyard script (not that there are THAT many).
Post Reply
alfie
Posts: 3
Joined: Wed Aug 24, 2005 1:27 pm

PHP Text Hit Counter

Post by alfie »

Script URL: PHP Text Hit Counter
Version of script: 1.0
Version of PHP: don't know
Hosting company: Everyones internet
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try: Text AND Hit AND Counter, "Text Hit Counter"

Write your message below:

I've recently installed the PHP Text Hit Counter on a test web site (http://a-m-legal.com/test.htm) and it will not display the count. The test.log file is getting updated but just won't display. If you look at he web site it looks like the display is missing.

thanks

alfie
alfie
Klemen
Site Admin
Posts: 10114
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hi,

You have this doe for the counter:

<IMG SRC="http://a-m-legal.com/counter/counter.php?page=test" WIDTH=96 HEIGHT=32>

According to the readme.htm you should use THIS code:

<SCRIPT LANGUAGE="Javascript" SRC="http://a-m-legal.com/counter/counter.php?page=test"><!--
//--></SCRIPT>

Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
alfie
Posts: 3
Joined: Wed Aug 24, 2005 1:27 pm

PHP Text Hit Counter

Post by alfie »

I've been working on this for a couple of days through various modifications of the script. If you now look at a-m-legal.com/test.htm you'll see that the script is now as per the readme but it still doesn't work.

If you look at a-m-legal.com/test1.htm it "semi" works but the counter img is not there.

I use WEB Easy to develope my web page so I'm not sure what is going on. What I've been doing is saving the "Page Source" to my computer and editing the .htm code manually. That is how I got test1.htm to work.

any more suggestions?

thanks

alfie
alfie
Guest

PHP Text Hit Counter

Post by Guest »

I believe I know what part of my problem was. I was trying to use a graphical counter with your "PHP Text Hit Counter" that was why my image was not appearing.

So I downloaded your Gcounter and am trying it, but it's still not working.
My new "test" web page is "a-m-legal.com/testindex.htm"

alfie
Klemen
Site Admin
Posts: 10114
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Alfie,

You still have the wrong code there, you have this:

Code: Select all

<IMG SRC= <SCRIPT LANGUAGE = "Javascript" SRC ="http://a-m-legal.com/phpgcount/graphcount.php?page=testindex"><!--//--></SCRIPT> WIDTH=96 HEIGHT=32>
But it should be THIS:

Code: Select all

<SCRIPT LANGUAGE = "Javascript" SRC ="http://a-m-legal.com/phpgcount/graphcount.php?page=testindex"><!--
//--></SCRIPT>
You shouldn't insert the code as an IMAGE code. See if you have anything like "Insert HTML code" or similar and paste the Javascript code there.

TRY THIS:
1. delete that code you have now
2. follow steps explained here:
http://www.phpjunkyard.com/tutorials/cut-paste-code.php
and paste this code as explained in the article:

Code: Select all

<SCRIPT LANGUAGE="Javascript"
SRC="http://a-m-legal.com/phpgcount/graphcount.php?page=testindex"><!--
//--></SCRIPT>
Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
alfie
Posts: 3
Joined: Wed Aug 24, 2005 1:27 pm

PHP Text Hit Counter

Post by alfie »

Thank you, Thank you, Thank you

When I "build" the page using the Web Easy software it puts the <IMC SRC and the height and width in there. I "ASSUMED" that it was needed for the graphic portion of the gif.

Looks like it's working now.

I really appreciate your help

Keep up the good work.

alfie
alfie
jook
Posts: 3
Joined: Thu Sep 03, 2009 12:35 am

Post by jook »

This thread is four years old, but hopefully someone will see this.

I've been fighting with this code all day, and it just won't display the count. I've changed the settings in counter.php, I've used relative and absolute paths for the script location, I've stored extra copies of all the files in extraneous locations, I've tried taking away the formatting I'm applying... nothing works.
All I get is exactly what's described in the original post: the test and index .txt files update (I even made .log versions since that was the old way) but It's completely empty on my page.
The site I'm working with is http://erilyyn.info and the relevant bit of code is this:

Code: Select all

<p STYLE="position:absolute;bottom:10;right:20;">
##
<SCRIPT LANGUAGE = "Javascript" SRC ="counter/counter.php?page=index"><!--
//--></SCRIPT>
</p>
The two hashes (##) are just there as a placeholder so I can make sure the positioning is right.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello jook,

Please post the info as asked in this thread viewtopic.php?t=79
You would have seen it if you had started a new thread for your question.

Especially point b) , the link to the URL of phpinfo.php is needed.
Because i wonder if your server supports php.

Greetings,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
jook
Posts: 3
Joined: Thu Sep 03, 2009 12:35 am

Post by jook »

Sorry... let me try this again. I only got here from the link on the script page, so I didn't come through the whole forums to see the "read this first" thread.

1. Downloaded from here today: http://www.phpjunkyard.com/php-text-hit-counter.php
2. I've been over and over that readme file...
3. similar old forum topic? Doesn't get much older or similar-er than this thread.
4. Ditto above.
5. I found out I needed to be on a linux server to be able to CHMOD, so I had my hosting company (godaddy) switch over. Doesn't work afterwards either.
6. I spent hours on this...


a) Well, I'm not starting a thread...

b) http://erilyyn.info/phpinfo.php
http://erilyyn.info/session_test.php
http://erilyyn.info/session_test2.php
I don't understand everything given by the phpinfo page, but the test scripts seem to show success.

c) see my previous post.

As far as I can see, everything seems the way I see that it ought to be... On the odd chance that something wasn't right, I've pored over the PHP files (What I could understand of it - I don't know PHP), messed with the formatting for my HTML page, tried changing the way the javascript command would show up (I don't know javascript either - these efforts met with failure), and changed the contents of my log file. The best I can get is a nothing.
Not that "nothing" is good... just better than an error, I suppose.

In the end, to get the functionality of a page counter, I ended up plugging in an offsite script, but I don't like not knowing what that site is doing with my statistics, or what's in their script, or the fact that I'm given no choice in it being hyperlinked back to them. I'm not averse to crediting where it's due, but I prefer to have control over it.
...in accordance with the prophecy.
Klemen
Site Admin
Posts: 10114
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

It's a simple problem: your host (GoDaddy) is adding a piece of code to each your web page to display ads. This code is breaking the javascript that the counter generates.

If you open your counter directly you will see it actually works:
http://erilyyn.info/counter/counter.php?page=index

But because GoDaddy adds the top banner code it breaks the Javascript so it's not valid anymore and doesn't show in your browser when you call it with the <script ...></script> tags.

The solution? I'm afraid the only solution is to switch to a host (or a hosting plan) that doesn't add any code (ads) to your pages. Otherwise you will not be able to use any script that generates Javascript code for example.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
jook
Posts: 3
Joined: Thu Sep 03, 2009 12:35 am

Post by jook »

Klemen wrote:It's a simple problem: your host (GoDaddy) is adding a piece of code to each your web page to display ads. This code is breaking the javascript that the counter generates.

If you open your counter directly you will see it actually works:
http://erilyyn.info/counter/counter.php?page=index
Yeah, I knew it was working. I'd tried that URL. It was just getting it to display that wasn't working...
The problem is really something as mundane as the banner ad? That's terrible.... I didn't even know there was going to be an ad when I was setting up the site... Didn't see it at all 'til I tested it in IE, because of adblock in firefox.
Oh well, at least now I've got a solid answer. Thanks a lot for your help. I'll look into getting nicer hosting.
...in accordance with the prophecy.
Post Reply