validation regex php

nonai

BANNED
Joined
Oct 10, 2013
Messages
535
Reaction score
77
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

numbers
letters
-
dot
(
)
:
space

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.
Code:
^([\d\.()\:\- ]+)(ext(ension)?:\s+\d+)?$
 
Back
Top