Jump to content

[SOLVED] simple contact form


Djotara

Recommended Posts

Hey php freaks!

 

I am still a php rookie and need your help. I am sure you will find it quite simple...

 

I am making email form for my site and everything is perfect except when the mail is sent everything is in one line... Here is the code that should be edited:

 

<?php

$first_name = $_REQUEST['name_first'];

$company = $_REQUEST['company'];

$position = $_REQUEST['position'];

$email = $_REQUEST['email'];

$presentation_title = $_REQUEST['presentation_title'];

$presentation = $_REQUEST['presentation'];

$trip = $_REQUEST['trip'];

$abstract = $_REQUEST['abstract'];

 

$email_message = "Name: {$first_name} Faculty/Company: {$company} Position: {$position} E-mail: {$email}  Presentation Title: {$presentation_title}  The presentation will be {$presentation} Conference Trip: {$trip} Abstract:{$abstract} ".$field;

 

mail('[email protected]', 'Form response', $email_message);

 

?>

 

I know this is a piece of cake for you and thanks in advence!

 

Cheers

 

Djotara

Link to comment
https://forums.phpfreaks.com/topic/182291-solved-simple-contact-form/
Share on other sites

Since it's a plain text e-mail simply placing line breaks in the string should maintain them in the e-mail.

 

$email_message = 
"Name: {$first_name} 
Faculty/Company: {$company} 
Position: {$position} 
E-mail: {$email}   
Presentation Title: {$presentation_title}   The presentation will be {$presentation} 
Conference Trip: {$trip} Abstract:{$abstract} ".$field;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.