1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

validation regex php

Discussion in 'BlackHat Lounge' started by nonai, Apr 27, 2014.

  1. nonai

    nonai Power Member

    Oct 10, 2013
    Likes Received:
    my contact form is getting spammed to death. just this morning I received 100s of messages in my inbox. I dont want to use captcha. I dont have wordpress so there are no plugins that will help me.

    The one thing the spam messages have in common is that they contain a url in the phone number field. A url always has forward slashes because of the http://

    How can I disallow forward slashes so if a field has forward slashes, the form doesn't get submitted?

    People can be very unpredictable when entering their phone number so I want to allow


    why letters you ask? because some people might put "extension 123"

    how can I do that using php validation regex?

    This is something I found on another website but it's no good.
    ^([\d\.()\:\- ]+)(ext(ension)?:\s+\d+)?$