Jump to content

Recommended Posts

I'm working on a small job application for a company, using basic sendmail and a form. Here's the sendmail code:

 

<?php
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;
  $firstname = $_REQUEST['firstname'] ;
  $lastname = $_REQUEST['lastname'] ;
  $telephone = $_REQUEST['telephone'] ;
  $driverslicense = $_REQUEST['driverslicense'] ;
  $position = $_REQUEST['position'] ;
  $address = $_REQUEST['address'] ;

  mail( "[email protected]", "Job Application",
    $message . $firstname), "From: $email" );
  header( "http://blah.com" );
?>

 

You can see where the strings are returned, message and firstname, I need a new line inserted between them. I've tried using . \n . and . '\n' . and . $newline . and a few other ideas but its not happening. Can anybody shed some light on the subject please? :)

Link to comment
https://forums.phpfreaks.com/topic/97999-alternatives-to-newline-code-n/
Share on other sites

Thanks for the quick reply, ok so I tried this:

 

<?php
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;
  $firstname = $_REQUEST['firstname'] ;
  $lastname = $_REQUEST['lastname'] ;
  $telephone = $_REQUEST['telephone'] ;
  $driverslicense = $_REQUEST['driverslicense'] ;
  $position = $_REQUEST['position'] ;
  $address = $_REQUEST['address'] ;

  mail( "[email protected]", "Job Application",
    $message . "\n" . $firstname), "From: $email" );
  header( "blah.com" );
?>

 

and was returned this:

Parse error: syntax error, unexpected ',' in /home/hodd5538/public_html/sendmail.php on line 12

 

Am I still doing something wrong somewhere?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.