title: PHP Form Not Showing Full Information on Submission
body: <p>I have a very simple form from a template with just three fields - Name - Email - Phone. When submitted the form works. BUT - if in the name field you have two words, e.g, John Smith - then it still submits but then everything after the first word gets truncated - so for the example, the mail received would show only "john" and not show "smith", neither will it show email or phone values. I have given my code samples below.. any help is highly appreciated.</p>
  
  <p>PHP CODE BELOW</p>
  
  <pre><code>&lt;?php 
  $to = 'x@gmail.com, y@gmail.com' ; // Put in your email address here
  $subject  = "Appointment Request"; // The default subject. Will appear by   default in all messages. Change this if you want.
  
  // User info (DO NOT EDIT!)
  $name = stripslashes($_REQUEST['name']); // sender's name
  $email = stripslashes($_REQUEST['email']); // sender's email
  $phone = stripslashes($_REQUEST['phone']); 
  
  // The message you will receive in your mailbox
  // Each parts are commented to help you understand what it does exaclty.
  // YOU DON'T NEED TO EDIT IT BELOW BUT IF YOU DO, DO IT WITH CAUTION!
  $msg  = "Name: ".$name."\r\n";  // add sender's name to the message
  $msg .= "E-mail: ".$email."\r\n";  // add sender's email to the message
  $msg .= "Phone: ".$phone."\r\n";  // add sender's email to the message
  $msg .= "Subject: ".$subject."\r\n\n"; // add subject to the message (optional! It will be displayed in the header anyway)
  $msg .= "---Message--- \r\n";
  $msg .= "\r\n\n"; 
  
  $mail = @mail($to, $subject, $msg, "From:".$email);  // This command sends the e-mail to the e-mail address contained in the $to variable
  
  if($mail) {
  echo 'Your message has been sent, we will be in touch shortly!';  //This is the message that will be shown when the message is successfully send
  
  } else {
  echo 'Message could not be sent!';   //This is the message that will be shown when an error occured: the message was not send
  }
  
  ?&gt;
  </code></pre>
  
  <p>HTML FORM CODE</p>
  
  <pre><code>&lt;form role="form" onSubmit="return send_email();"&gt;
  
  &lt;div class="form-group"&gt;
  
  &lt;label for="exampleInputName"&gt;Name&lt;/label&gt;
            &lt;input type="text" class="form-control" id="app_name" placeholder="Name" required&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
            &lt;label for="exampleInputEmail1"&gt;E-mail&lt;/label&gt;
            &lt;input type="text" class="form-control" id="app_email" placeholder="E-mail" required&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
            &lt;label for="exampleInputPassword1"&gt;Phone&lt;/label&gt;
            &lt;input type="text" class="form-control" id="app_phone" placeholder="Phone"&gt;
          &lt;/div&gt;
          &lt;button type="submit" class="btn btn-block btn-orange btn-Submit" onclick="ga('send', 'event', 'formsubmit', 'lp form', 'LP form');"&gt;Book my Free Consultation&lt;/button&gt;
          &lt;small id="mail_msg"&gt;&lt;/small&gt;
        &lt;/form&gt;
  </code></pre>
  
  <p>send_email() is actually in a JS file in a separate JS folder.. I have pasted the code below..</p>
  
  <p>JS send_email</p>
  
  <pre><code>function send_email() {
  var name=$("#app_name").val();
  var email=$("#app_email").val();
  var phone=$("#app_phone").val();
  if(name=="")
  {
  $("#app_name").addClass("errors");
  }
  else
  {
  $("#app_name").removeClass("errors");
  }
  if(!validEmail(email))
  {
  $("#app_email").addClass("errors");
  }
  else
  {
  $("#app_email").removeClass("errors");
  }
  if(phone=="")
  {
  $("#app_phone").addClass("errors");
  }
  else
  {
  $("#app_phone").removeClass("errors");
  }
  
  if(name!="" &amp;&amp; phone!="" &amp;&amp; validEmail(email) )
  {
  $("#mail_msg").load("email.php?name="+name+"&amp;email="+email+"&amp;phone="+phone);
  $("#app_name").val('');
  $("#app_email").val('');
  $("#app_phone").val('');
  }   
  return false;
  }
  function validEmail(e) {
  var filter = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
  return String(e).search (filter) != -1;
  }
  </code></pre>