[thelist] PHP_SELF / Contact Form

DAVOUD TOHIDY dtohidy at hotmail.com
Wed Aug 4 14:17:38 CDT 2010

> From: kipper_timmins at live.co.uk
> To: thelist at lists.evolt.org
> Date: Wed, 4 Aug 2010 19:46:55 +0100
> Subject: Re: [thelist] PHP_SELF / Contact Form

> Ahh this sounds like a new line issue to me from what I can glean.
> Could you let us know what isn't working? is it the text area not showing, 
> information not getting through the validation?
> You might need to replace \n\r with your own newline characters such as 
> [newline] or something like that with a string replacement.
> Sorry I can't be more specific,
> Hope this helps a bit
> Kevin

validation was not working for text area.

I replaced the regex with this one (added the '\S):

if(!preg_match("/^([a-zA-Z0-9_\'\s'\S]{1,200}+)/", $message)){
$errMsg7 .= "Please enter only words and numbers";
$valid = false;

this now fixed the validation problem. So it does the validation if there are multiple line of message.

However if there is another field having validation problem then the user message (<?php echo($message)?>)
retained inside the text area would have /n/r characters.

I tried $message = preg_replace( "#\r\n|\n|\r#", '<br />', $message );
and $message = str_replace( array("\r\n", "\n","\r"), '<br />', $message );

but does not do anything. 


More information about the thelist mailing list