Re: indexing with fopen

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

 



You are essentially re-inventing ht://dig which is probably a Bad Idea.

But if you want to fopen() a URL, you have to have 'http://' on the
front of it, so PHP knows it's a URL, and not a very oddly-named file.

On Sun, February 25, 2007 12:43 pm, Miguel Vaz wrote:
>
> 	Hi,
>
> 	I am trying to add a search to the site i am developing but i ran
> into a bit of a problem.
>
> 	Since the site is mainly dynamic (lots of includes and mysql
> queries), i thought of building an index table that will contain the
> insides of all the pages in the site tree. I was thinking of opening
> each page with fopen, stripping the html, and storing it in a
> database table. Then i would only search there.
>
> 	The problem is that i cant seem to read the pages with fopen:
>
> 	example of urls:
>
> 	index.php?m=1
> 	index.php?m=1&s=3
>
> 	If i try to do this:
>
> 	$page=fopen('index.php?m=1',"r");
> 	if($page){
> 		while (!feof($page)) {
> 			$buff = fgets($page,4096);
> 			$totalpage .= $buff;
> 		}
> 	}else{
> 		echo "error";
> 	}
>
> 	I dont get the resolved content in $totalpage, but i get the
> includes and php commands that are inside index.php, which i find
> very strange. Should they resolve before they are retrieved?
>
> 	Any help is highly appreciated. Thanks.
>
> 	Miguel
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
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