[thelist] PHP_SELF / Contact Form

DAVOUD TOHIDY dtohidy at hotmail.com
Wed Aug 4 11:20:20 CDT 2010




> From: dtohidy at hotmail.com
> To: thelist at lists.evolt.org
> Date: Wed, 4 Aug 2010 11:04:43 -0400
> Subject: Re: [thelist] PHP_SELF / Contact Form


It works when the message is in one line. However when multiple line of message entered it does not.

Any idea how to add the support for multiple line into the Regex?




> I am using the following for text area :
> 
> if(!preg_match('/^([a-zA-Z0-9_\'\s]+)$/', $message)){
> $errMsg7 .= "Invalid Entry, Please enter only words";
> $valid = false;
> } 
> 
> and:
> 
> if(strlen($message) > 200 ){
> 
> // sets max amount of characters in comments area (edit as nesesary) 
> 
> $message=substr($message, 0, 200).'...';
> $error .="We are sorry for inconvenience. Your message should not exceed 200 characters.<br />";
> $valid = false; 
> }
> 
> and for the errors to show:
> 
> 
> <?php if(isset($errMsg6) && !empty($errMsg6)) {
> echo '<p class="message" >' . $errMsg6 . '</p>';
> }?>
> 
> <textarea name="message" id="message" rows="15" cols="50" value="" ><?php echo($message)?></textarea>
> 
> But it does not work.  Any idea would be appreciated.

 		 	   		  


More information about the thelist mailing list