Message Validator

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
schneina
Forum Newbie
Posts: 2
Joined: Sun Nov 30, 2008 2:54 pm

Message Validator

Post by schneina »

I'm allowing users to post messages on my site but there are certain things I want to look for in the message:

E-mail address
Phone numbers
Addresses
Curse words

Does anyone know of such an API or function calls to accomplish this task?
maneetpuri
Forum Commoner
Posts: 60
Joined: Tue Oct 07, 2008 6:32 am

Re: Message Validator

Post by maneetpuri »

Hi,

I am not sure if there is any API available for it, but its very simple and you can code it. You will have to design a form with these fields, which when submitted will be stored in the database and on the message board pick this from the database and display them

Hope this helps.

Cheers,

~Maneet
schneina
Forum Newbie
Posts: 2
Joined: Sun Nov 30, 2008 2:54 pm

Re: Message Validator

Post by schneina »

What I'm actually looking for is something that checks for these things and throws an error if these things exist in a message.

Does this help?
User avatar
The_Anomaly
Forum Contributor
Posts: 196
Joined: Fri Aug 08, 2008 4:56 pm
Location: Tirana, Albania

Re: Message Validator

Post by The_Anomaly »

I'm sure it'd be pretty slow, but I'm sure you can use some regex and string functions to check for it all. Check out the preg_* and str* functions, and learn some regex.
Post Reply