Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 3rd, 2006, 02:42 PM
lmayer lmayer is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: USA
Posts: 225 lmayer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Best way to set up a "letter"

Morning,

I am trying to figure out the best way to do this. I have a bunch of letters that an office sends out. I want to save the body of the letter in a table as well as another table for the personal information. The problem is some of the letters midway imbed the personal information. Is there a better or easier way to do this than what I am doing currently, which is a field for each section/paragraph and have the code something like this?
php Code:
Original - php Code
  1.  
  2. $mailbody =
  3. $First_Name . " " . $Last_Name ."<p>Dear " . $First_Name . ":<p>" . $Letter ."<br/ >"
  4. date("h:i A",strtotime($Group_Interview_Time)) . "&nbsp;&nbsp;&nbsp;" . $Group_Interview_Room .
  5. "&nbsp;&nbsp;&nbsp;Group Process    Interview<br/>"date("h:i A",strtotime($Interview_Time)) . "&nbsp;&nbsp;&nbsp;" . $Interview_Room  . "&nbsp;&nbsp;&nbsp;Individual Interview<p>" . $Footer;


Thanks for any thoughts.

Laura

Reply With Quote
  #2  
Old November 4th, 2006, 01:54 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: Best way to set up a "letter"

Well, if you want to save the body of a letter in a table and then be able to replace data within the body, I'd template the letter somehow. For instance, I might save the following in the table:
Code:
Dear <<first_name>>,
Thanks for visiting with us on <<vist_date>.
I hope to see you again!
Sincerely,
<<managers_name>>


Then, I'd have PHP code that pulled the personal info from the other table and did substr_replace()'s on the template tags I made up.

Is that the sort of thing you are looking for?

Reply With Quote
  #3  
Old November 6th, 2006, 12:34 PM
lmayer lmayer is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: USA
Posts: 225 lmayer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Best way to set up a "letter"

Thanks Matt,

Yes thats what I'm looking for...some way to make the template in a table. I'll check that out. Thanks for the tip.

Laura

Reply With Quote
  #4  
Old November 6th, 2006, 01:30 PM
lmayer lmayer is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: USA
Posts: 225 lmayer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Best way to set up a "letter"

I tried your suggestion Matt it worked like a charm.

Thanks Again.

Laura

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > Best way to set up a "letter"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway