I am guessing that you are trying to protect your form from spammer, however HTTP_REFERER is set by the users browser and can be faked. The forum should be protected from spam by a fixed to address so they can only send spam to you. If you still want to do it you can use a preg_replace to remove http and www and then check if it has your root domain in it.
Scott
2009-12-31 18:41:33