WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Site Design > Graphics & Design Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox 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.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-19-2008, 05:34 PM
Sky Captain Sky Captain is offline
WebProWorld Member
 

Join Date: Jun 2004
Location: Rochester, NY
Posts: 46
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, 08:21 PM
sands's Avatar
sands sands is online now
WebProWorld Veteran
 

Join Date: Sep 2005
Location: Kerala, India
Posts: 397
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
Reply With Quote
  #3 (permalink)  
Old 05-20-2008, 12:24 PM
Sky Captain Sky Captain is offline
WebProWorld Member
 

Join Date: Jun 2004
Location: Rochester, NY
Posts: 46
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 12: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

vB 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 05:32 AM
Passing form data to remote form on another site webace Graphics & Design Discussion Forum 8 08-31-2007 03:21 AM
Form Post Redirect to Form Get GiftsForYouBiz Web Programming Discussion Forum 0 09-26-2006 04:51 PM
Web 2.0 Bullsh*t Generator™ kgun Breakroom (General: Any Topic) 2 04-04-2006 12:56 AM
Form problems using Visual Form Mail whatever Graphics & Design Discussion Forum 7 01-04-2006 03:14 PM


Search Engine Friendly URLs by vBSEO 3.0.0