Jump to content

Alternatives to newline code? (\n)


the_real_JLM

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?

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.