iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-19-2008, 06:34 PM
WebProWorld Member
 
Join Date: Jun 2004
Location: Rochester, NY
Posts: 60
Sky Captain RepRank 0
Default PHP Form Generator coding issue

I've been using the PHP Form Generator (downloaded from SourceForge.net) for email forms on a website. I've posted a question on their boards, but haven't got much of a response. Maybe someone here can help.

So far the PHP code is working great. I have forms that visitors fill out, and we get the messages in our email.

However, when people write us messages with paragraph breaks, we get <br /><br /> in the received emails.

Is there a way to smooth this out so we get actual breaks instead of the HTML code?

I'll post the code and some links if anyone wants to take a look.
Reply With Quote
  #2 (permalink)  
Old 05-19-2008, 09:21 PM
sands's Avatar
WebProWorld Veteran
 
Join Date: Sep 2005
Location: Kerala, India
Posts: 395
sands RepRank 1
Default Re: PHP Form Generator coding issue

Use this bit of code to do so:
Code:
$message = str_replace("<br />", "\r\n", $message);
Where "message" is the name of the input field.
__________________
My Nook | My Biz | My Photos
Reply With Quote
  #3 (permalink)  
Old 05-20-2008, 01:24 PM
WebProWorld Member
 
Join Date: Jun 2004
Location: Rochester, NY
Posts: 60
Sky Captain RepRank 0
Default Re: PHP Form Generator coding issue

Wow, that was easy.

I didn't know quite where to put it at first, but then swapped it for this section:

$message=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $message);

Thank You!

Last edited by Sky Captain; 05-20-2008 at 01:28 PM.
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sitemap generator duongo75 Search Engine Optimization Forum 3 10-08-2007 06:32 AM
Passing form data to remote form on another site webace Graphics & Design Discussion Forum 8 08-31-2007 04:21 AM
Form Post Redirect to Form Get GiftsForYouBiz Web Programming Discussion Forum 0 09-26-2006 05:51 PM
Web 2.0 Bullsh*t Generator™ kgun The Castle Breakroom (General: Any Topic) 2 04-04-2006 01:56 AM
Form problems using Visual Form Mail whatever Graphics & Design Discussion Forum 7 01-04-2006 04:14 PM


All times are GMT -4. The time now is 12:19 AM.



Search Engine Optimization by vBSEO 3.3.0