Page 1 of 1

add counter

Posted: Sun Oct 28, 2012 4:57 am
by Noelb
Hi,
Is there a way to use a local php counter script?
I've even tried the html page nugget, even the manage styles area for counter code
eg:

php-tag_removed

include /path/to/script
end_end-tag_removed

all I'm trying to do is add (with brackets etc removed incase forum strips stuff
mysql_connect stuff
mysql_select_db stuff
mysql_query UPDATE counter SET count = count + 1

VAR_4_hitcount = mysql_fetch_row stuff

and print and echo statements, the count value wont appear, it prints the actual code :)
I know there's a plugin to allow inclusion of php code, but, like its warning, I too think too dangerous to use and still not sure if that'd even work.

I know the code works, I use it on another website of mine.

Any hints at how I can overcome this niggling problem?

Cheers

Re: add counter

Posted: Mon Oct 29, 2012 1:27 pm
by garvinhicking
Hi!

You need to use the PHP include script plugin you referred to. The other option is EVEN MORE dangerous.

Generally, allow to embed PHP code is dangerous and not recommended. The proper way to do it is create your own s9y plugin that executes the code.

Regards,
GArvin