Posted on 2009-02-19
Last Modified: 2012-06-21
I am working on modifying a php form step by step that was generated by a form creator. I have two separate input checkboxes. I figured out how to use implode() to insert everything into one column in the mysql database. All of the data is inserting correctly. I have an email that sends a notice to me that the form has been filled out. Since I inserted the implode() statement, it runs together a couple of the values on my email. I was wondering what I could do to fix this. For example, my email reads

If yes, what position: Acct
Positions interested in: TicketSeller, TicketTaker, Traffic Position interested in but not listed: Usher Date available to start work at the Fair: 09/10/09 Days available to work: m-f Hours available to work: 8-5
Employer: ksf

There should be a line break beginning with "Position interested in but not ".  I wondered if the comma separated values have anything to do with it. The coding for the $message variable is listed below.

Any  help is appreciated. Please let me know if you need to see more of the coding.
$message="First name: ".$FirstName."

Last name: ".$LastName."

Street: ".$Street."

City: ".$City."

State: ".$State."

Zip code: ".$ZipCode."

Cell phone number: ".$CellPhone."

Day phone number: ".$DayPhone."

Evening phone number: ".$EveningPhone."

High school graduate: ".$HSGraduate."

College years completed: ".$CollegeYearsCompleted."

College name: ".$CollegeName."

Age 18 or older: ".$Age18."

Worked at the Fair before: ".$PriorFairWorker."

If yes, what position: ".$PositionWorked."

Positions interested in: ".$PositionsInterestedIn."

Position interested in but not listed: ".$PositionsNotListed."

Date available to start work at the Fair: ".$DateAvailable."

Days available to work: ".$DaysAvailable."

Hours available to work: ".$HoursAvailable."

Employer: ".$Employer1."

Street: ".$Street1."

City: ".$City1."

Employment dates: ".$EmploymentDates1."

Duties performed: ".$DutiesPerformed1."

Employer: ".$Employer2."

Street: ".$Street2."

City: ".$City2."

Employment dates: ".$EmploymentDates2."

Duties performed: ".$DutiesPerformed2."

Employer: ".$Employer3."

Street: ".$Street3."

City: ".$City3."

Employment dates: ".$EmploymentDates3."

Duties performed: ".$DutiesPerformed3."

Skills: ".$Skills."

Computer skills: ".$ComputerSkills."

Other skills: ".$OtherSkills."

Comments: ".$Comments."


Open in new window

Question by:acecraig100
    LVL 15

    Accepted Solution

    I don't think the implode() function has done anything to your message.  I think you simply need to add line breaks, as it won't recognize the carriage returns in your code as breaks.


    $message="First name: ".$FirstName."\n
    Last name: ".$LastName."\n
    Street: ".$Street."\n
    City: ".$City."\n
    State: ".$State."\n
    Zip code: ".$ZipCode."\n";

    Open in new window


    Author Closing Comment

    Thanks for the help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    The viewer will learn how to dynamically set the form action using jQuery.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now