Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PHP CHECKBOXES, IMPLODE FUNCTION

Posted on 2009-02-19
2
Medium Priority
?
279 Views
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

0
Comment
Question by:acecraig100
2 Comments
 
LVL 15

Accepted Solution

by:
Tomeeboy earned 2000 total points
ID: 23684986
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.

Example:

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

Open in new window

0
 

Author Closing Comment

by:acecraig100
ID: 31548881
Thanks for the help.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month20 days, 16 hours left to enroll

810 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