Re: Searching a file

From: Date: Wed, 23 Apr 2003 01:48:59 +0000
Subject: Re: Searching a file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-144937@lists.php.net to get a copy of this message
Those are good suggestions but I doubt they'd know how, no offense of some of the people on here are hosted by the people I work for.. ;-) I still have one more question aside from the extenstions thing. I got to thinking, I have these hosted sites on something like 3 different servers. How can I open the root directory for all of them from one of those servers only? I tried just putting their web address with the trailing slash and got a Warning: opendir(http://www.slicerhq.com/) [function.opendir]: failed to open dir: not implemented in c:\inetpub\wwwroot\dodb.php on line 31 Any help on this and the extension problem would be nice. Thanks, Stephen Craton http://www.melchior.us ----- Original Message ----- From: "John W. Holmes" <holmes072000@charter.net> To: "'Stephen'" <webmaster@melchior.us>; "'PHP List'" <php-general@lists.php.net> Sent: Tuesday, April 22, 2003 8:44 PM Subject: RE: [PHP] Searching a file > I have some hosted sites and would like regularly check to make sure they > have my ad code on each page. What I'm doing is having a corn job open a Potato jobs are much faster... ;) > check script every week or so to make sure that each file of theirs has > the code. > > My trouble is actually searching the file. What I'm doing right now is > getting an array of files in the root directory then will do a foreach > function looping through the array of files. I then open the file in the > array part it's looking at in the loop and then I just don't know what to > do. I have the file open, how do I make sure that somewhere in that file > it has the code required? You can just do a strstr() or strops() match for the code of your add. Maybe use a regular expression if it's complex. This may work most of the time, but you really won't know if the person is displaying the add or not. What if they have your code, but it's commented out? Or maybe they positioned a <div> over top of it, so no one can see it... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.general (#144937) next »