Not allow a href tags in form textarea

Posted by saquib on Stack Overflow See other posts from Stack Overflow or by saquib
Published on 2010-06-09T07:44:17Z Indexed on 2010/06/09 7:52 UTC
Read the original article Hit count: 141

Filed under:
|
|

Hello friends,

How can i prevent user to enter any url or link in contact form text area, i have tried it with this but its not working -

   if (!isset($_POST['submit']) && preg_match_all('/<a.*>.*<\/a>/', $_POST['query']))
      {
   echo "<h1 style='color:red;'>HTML Tag Not allowed </h1>";
      }
   else {
       //sendmail 
      }

Please help me

© Stack Overflow or respective owner

Related posts about php

Related posts about html