Page 1 of 1

checking ip & encoding

Posted: Tue May 22, 2007 6:46 am
by m2babaey
to remind some:
i have a form for users to submit articles and want the articles be publicly viewable.
thanks for your helps in my other topics. now:

1. I want to record the ip from where the article is being submitted. How can I do that?

2. I'm counting the number of times each article is viewed. but need 2 things.
I don't want the counting work if the owner's articles is being read from an IP that he has already logged in. Why? because I pay the writers according to the number of times their articles has been read and don't want to pay them if they read their articles themselves.

3. The language I'm creating this cms for is not English. so I want the users to view the webpages in a unicode-utf8 encoding. (automatically) what should I do for that?

Posted: Tue May 22, 2007 7:13 am
by feyd
  1. Look in $_SERVER
  2. You will need to cross reference the current IP against your view records.
  3. Make sure everything is UTF-8, and you should be fine. That includes setting all the proper headers and such. It's a bit complicated, but has also been talked about here many times

Posted: Tue May 22, 2007 9:34 am
by m2babaey
feyd wrote:
  1. Look in $_SERVER
  2. You will need to cross reference the current IP against your view records.
  3. Make sure everything is UTF-8, and you should be fine. That includes setting all the proper headers and such. It's a bit complicated, but has also been talked about here many times
1 & 2 are almost solved.
But need more explanation with 3 :roll: thanks
You may notice that I have only 2 include.php files and all articles will be there. so i think it won't be difficult :idea:

Posted: Tue May 22, 2007 2:32 pm
by m2babaey
also 3 was solved. thanks