Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 2337 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Adding html output for Error Messages in contact form...

Thread title: Adding html output for Error Messages in contact form...
Closed Thread    
    Thread tools Search this thread Display Modes  
03-26-2009, 10:18 AM
#1
phpfreelancerbe is offline phpfreelancerbe
Status: I'm new around here
Join date: Mar 2009
Location:
Expertise:
Software:
 
Posts: 2
iTrader: 0 / 0%
 

phpfreelancerbe is on a distinguished road

  Old

If a client wants fancy validation i mostly use http://www.livevalidation.com/

Of course all user input is tainted so you still need to filter all input to make your application secure. It is best you use whitelist method for total control. You can check if input is alphanumeric with ctype_alnum(); you can also use regular expressions to filter everything out of a string so you only are left with alphanumeric data.

Example
PHP Code:
<?php 
if(!ctype_alnum($_POST['name'])) { 
    
$name preg_replace('/[^A-Za-z0-9 ]/''',$_POST['name']); 
} else { 
    echo 
"WIN"

?>
Hope this was what you were looking for.

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed