[thelist] PHP_SELF / Contact Form

Kevin Timmins kipper_timmins at live.co.uk
Wed Aug 4 15:17:19 CDT 2010


if you store the message as <br /> and then whenever you want to see the 
message just have a small script that replaces <br /> with \n\r.
i'm not sure what else you could do on that

--------------------------------------------------
From: "DAVOUD TOHIDY" <dtohidy at hotmail.com>
Sent: Wednesday, August 04, 2010 9:11 PM
To: <thelist at lists.evolt.org>
Subject: Re: [thelist] PHP_SELF / Contact Form

>
>
>
>> 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
>
>
> I found what is causing the problem:
>
> I have:
>
> $message = 
> mysql_real_escape_string(htmlentities(strip_tags(stripslashes(trim($_POST['message'])))));
>
> mysql_real_escape_string is causing the /n/r to show up inside the text 
> area where the user message
> is retained when the user submits the form. Removing 
> mysql_real_escape_string along with adding:
>
> <?php  $message = str_replace(array("\r\n", "\n", "\r"),"<br 
> />",$message); echo($message)?>
>
> between the <textarea></textarea>  will replace the \r and \n with <br />
>
> However:
>
> 1-I do not want to remove the mysql_real_escape_string
> 2-I do not want to have the <br /> either
>
> What I would like to have is just a new line exactly as the user had 
> typed.
>
> removing the <br /> from the above will remove the space between 
> paragraphs in the message.
>
> Any ideas? Anyone?
>
> Thanks
> davoud
>
> -- 
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
> 


More information about the thelist mailing list