Re: Filter php page

From: Date: Wed, 05 Jul 2006 16:54:37 +0000
Subject: Re: Filter php page
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-239148@lists.php.net to get a copy of this message
On 05/07/06, Jay Blanchard <jblanchard@pocket.com> wrote:
[snip] can I create a script that will search a php page for iframes. And have it check the path of the iframe, If the iframe is listed as bad don't show. (list I make) Trying to do something with virus like through an iframe. I don't really know where to start looking for help. [/snip] Best thing to do is open the file, use regular expressions to capture all text that begins and ends with 'iframe', parse that for src=url, attempt to get the url, if it fails it's bad and you can rewrite the string back into the file, perhaps adding a css class such as 'class=bad' that has display set to none.
So, have a look at files, regular expressions and css. -- http://www.web-buddha.co.uk http://www.projectkarma.co.uk

« previous php.general (#239148) next »