Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Up front, I know little about PHP but am putting together a design for functionalality on a web site written in PHP.

Can anyone point me in the right direction for checking if a free text field has any HTML, URI's, E-Mail addresses or telephone numbers in it.

The idea is that a user can enter a message that will be sent anonymously to another user and we need to prevent, as much as possible, circumventing the system for further communication as we will be charging them for contact details.

As I said, I really need some help on how this can be done using PHP so I can explain it to the developers.

Any help will be much appreciated.
Posted
Comments
Sergey Alexandrovich Kryukov 25-Jul-12 13:09pm    
Do you need "checking" it or filtering out of the undesired information (which is more usually used)? And what's the problem?
--SA

1 solution

Short answer: use Regular Expressions:
http://php.net/manual/en/book.pcre.php[^].

Everything else depends on particular specifications you have to develop. There is no much to advise here: this is not about some expert recommendations but rather about some good volume of work and getting experience with those techniques.

—SA
 
Share this answer
 
v2
Comments
Nagy Vilmos 26-Jul-12 3:59am    
Thanks SA, I'll have to learn more about PHP then I'm happy about X|
Sergey Alexandrovich Kryukov 26-Jul-12 15:31pm    
You are welcome. Happy learning,
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900