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

In case you have problems with some other PHPJunkyard script (not that there are THAT many).
Post Reply
Exocet
Posts: 2
Joined: Fri Nov 18, 2011 10:58 am

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

Post 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.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

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

Post 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.
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
Exocet
Posts: 2
Joined: Fri Nov 18, 2011 10:58 am

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

Post 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.
Post Reply