<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1041350" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1041350</link>
    <description></description>
    <language>en</language>
          <item>
    <title>I haven&#039;t had chance to have</title>
    <link>https://www.webmaster-forums.net/webmasters-corner/total-page-view-count#comment-1231097</link>
    <description> &lt;p&gt;I haven&#039;t had chance to have a full test, but the serialize() seems like the solution to my issue.&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
 </description>
     <pubDate>Fri, 27 Jun 2008 16:19:17 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1231097 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>if the page view requires a</title>
    <link>https://www.webmaster-forums.net/webmasters-corner/total-page-view-count#comment-1230989</link>
    <description> &lt;p&gt;if the page view requires a log in you could append the viewer&#039;s user id&lt;/p&gt;
&lt;p&gt;but not if it is being anonymously viewed&lt;/p&gt;
&lt;p&gt;just a random thought&lt;/p&gt;
 </description>
     <pubDate>Thu, 26 Jun 2008 01:55:46 +0000</pubDate>
 <dc:creator>netsperience</dc:creator>
 <guid isPermaLink="false">comment 1230989 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Doing it by IP address is</title>
    <link>https://www.webmaster-forums.net/webmasters-corner/total-page-view-count#comment-1230949</link>
    <description> &lt;p&gt;Doing it by IP address is probably a bad idea because if a profile gets hit several times by a large network (different users), it will only count as one.  Same for a popular proxy.&lt;/p&gt;
&lt;p&gt;The cookie method isn&#039;t fool proof either because someone can just clear cookies to increase their page&#039;s count, but I think it is the best option.&lt;/p&gt;
&lt;p&gt;I would create a PHP array with the profile IDs as the keys, so when a page is viewed, run something like this:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$viewed_profiles&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$profile_id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Then to see if the page was view before, just test if that index exists.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$viewed_profiles&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$profile_id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]))&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// profile was viewed before&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// profile was not viewed before&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;If you are having trouble storing arrays in cookies, I would just serialize it first.  At the end of your script, do something like this:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$viewed_profiles &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;serialize&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$viewed_profiles&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;setcookie&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;viewed_profiles&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$viewed_profiles&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Then, at the top of the page, run something like this to retrieve it:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;viewed_profiles&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]))&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$viewed_profiles &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;unserialize&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;viewed_profiles&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$viewed_profiles &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= array();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 25 Jun 2008 17:30:37 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1230949 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
