Re: Query regarding total count of pages in a site....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, November 8, 2005 7:28 am, Suresh Pandian wrote:
> I need to find the number of webpages in a  site..
> is there any inbuilt variables in php  to find it.........
> Reply , if u have any valuable suggessions..........
> thanks.....

In your own site?

Or in somebody else's?

And what counts as a "page"?

If you want to count the number of FILES within a certain directory,
you could either use http://php.net/opendir and loop through
http://php.net/readdir with a $counter variable.

If you want to count all the URLs you can find on somebody else's
site, you'd have to use some kind of "spider" or "web walker" shell
framework and count the number of things you can download.  You could
"roll your own" but you risk screwing up big-time and slamming their
server with 1,000,000 hits in 1 second and making them really mad at
you...

And, finally, do you really want to count every "page"?

Consider this two "pages" from one of my sites:
http://uncommonground.com/artist_profile/Ellen+Rosner
http://uncommonground.com/artist_profile/artist_id/5

One is easier for humans to remember, one is easier for me to set upf
or the search engines to find, but they're not really "different"
pages, are they?

For that matter, it's just a template with database-driven content. 
So you could count it as 2000+ pages, or you could count it as 1 page.
 I can't argue against either one of those accountings, but which one
are you going after?  Cuz 2000 and 1 are not the same number, in most
countries...

You're really going to have to clarify what you want and why to act in
a reasonable manner.

One thing you may want to look at for ideas in this area are the
various web statistic packages you can install such as Webalizer (and
a few thousand similar packages).  Examining how they do what they do
may help you understand your problem better.  Or you may find that
they count the pages people are visiting, which is more interesting
that how many pages there are...

If a tree falls in the forest...
If a page lives on the 'net, but nobody visits it, is it really there?

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux