Page 1 of 1

Getting the php text counter to work inside an exis php page

Posted: Fri Nov 18, 2011 11:32 am
by Exocet
What terms did you try when SEARCHING for a solution: php text counter in existing php pages

I have the php text counter since v 1.1 and extremly happy with it in html pages, however I now have a need to use the same in side existing php pages.

I have added the following to the php, but causes problems, I'm pretty new to php so I'm fumbling in the dark a little.

Code: Select all

echo "<script language="Javascript\">\n";"
echo "src="http://www.tgsquad.com/counter/counter.php?page=index"><!--;\n";
echo "//--></script>";
This gives errors I have played around with the syntax moving bits of the lines around but i gave up and tried here for possible help.

Thanks and great scripts.

Re: Getting the php text counter to work inside an exis php

Posted: Fri Nov 18, 2011 1:13 pm
by Klemen
You need to properly escape all quotes in the code. This should work:

Code: Select all

echo "<script language=\"Javascript\" src=\"http://www.tgsquad.com/counter/counter.php?page=index\"><!--\n";
echo "//--></script>";
If not sure how to escape you can use a tool like this.

Re: Getting the php text counter to work inside an exis php

Posted: Mon Nov 21, 2011 2:55 pm
by Exocet
Yes! Now you worked it out for me I can see that many thanks that did it.
I'm probably trying to chew too much as a beginner, but there is always someone who can help, once again many thanks.