Re: eregi help
| From: | Andy Woolley | Date: | Thu, 17 Aug 2000 10:11:17 +0000 |
| Subject: | Re: eregi help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-12193@lists.php.net to get a copy of this message | ||
You could try
$pat = "xxx";
$url = www.xxxforyou.com";
if (strpos($url, $pat))
{
#xxx found
}
I would think about what you are trying to do very carefully, to block the
web site www.lookatthesebigbreasts.com for example you would need to add the
word "breast" to your list, this would inhibit legitimate web sites such as
www.breastcancer.com or www.chickenbreast.com
Equally, there are counties here in the UK and I think maybe in the US
called Essex and Sussex, obviously sex being a keyword could cause havoc in
your appplication.
The only proved way of stopping malicious input is quarantine of your data
with good old human interaction as your censor.
Andy.
----- Original Message -----
From: "Kris Howl" <nanarchy@iinet.net.au>
To: <php-general@lists.php.net>
Sent: Thursday, August 17, 2000 10:53 AM
Subject: [PHP] eregi help
> I've made a link submitter to work on my site. So the users type in their
> site name and url, click submit and it gets added to the list.
>
> However, to prevent idiots from adding links to unpleasant
> content/pornography I've created a filter. It's a txt document with a
bunch
> of words in it to disallow.
>
> The problem is this:
>
> $sitename = "xxx"
>
> That works fine. However, if someone uses:
>
> $sitename = "xxxforyou"
>
> It won't pick up the xxx part and disallow it. Is there a way to make sure
> it does pick up the "xxx" part? The code I'm using is:
>
> eregi ($sitename,$ono)
>
> $ono being the variable which stores the fgets of the text file with the
> words.
>
> To know how I can do this would be a great help, as I also have to block
> URLs that contain those words.
>
> Thanks in advance,
>
> Kris
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>