add counter

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Noelb
Regular
Posts: 78
Joined: Wed Jul 27, 2011 7:16 am

add counter

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: add counter

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply