Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7990693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:05:23+00:00 2026-06-04T13:05:23+00:00

I am trying to make a form letter using PHP. I have a view

  • 0

I am trying to make a form letter using PHP. I have a view that has a text area that has some pre-populated text. The text is like a letter: Dear So-and-so, etc.

There are a few places that I need to fill in specific, dynamic data from the db, but otherwise I need to let the user change the wording of the other parts of the email as necessary. I am thinking of putting a random character sequence to mark each place I am going to insert a new value.

So I submit the form to a PHP page and I pull the text out into a string variable. As I get ready to email it off I need to make sure that those placeholders are updated. How can I replace the contents of the string variable with the value of a variable?

EDIT – Example. This is what I currently have inside of the string variable in the PHP file that is processing the action of the form.

Hi %@

I hope you are doing well. I wanted to remind you that in %@ days you need to do something.

As a team we are currently at %@ percent.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:05:25+00:00Added an answer on June 4, 2026 at 1:05 pm

    What I use to do is something like as follows.

    $email_text = "Hello ###user###,    
                      You have a new Event on ###date### at ###time### for ###hours### hour.    
                      Please let me know if you are attending. 
    
                      Have Fun.
                      ###site###";
    
    $email_text =   str_replace('###user###',$username,$email_text);
    $email_text =   str_replace('###date###',date('M dS, Y', strtotime($date)),$email_text);
    $email_text =   str_replace('###time###',$time,$email_text);
    $email_text =   str_replace('###hours###',$hours,$email_text);
    $email_text =   str_replace('###site###',$site,$email_text);
    

    I hope this will make pretty much clear that, how you can work this out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a form that has inline editing (using jEditable) and
I am trying to make a form with some dynamic behavior. Specifically, I have
I'm trying to make a form that will take given text and direct you
I kinda have a problem. I'm trying to make a form that copies stuff
I am trying to make a form field for a datetime property that allows
I'm trying to make an AJAX form that will update a twitter status when
Trying to make a custom :confirm message for a rails form that returns data
I was trying to make a file upload form and checked the PHP documentation
I have a WPF form where I'm trying to make a simple input form.
I'm trying to make a form to login users into my webpage using mysql

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.