0

Parse error: syntax error, unexpected '$name' (T_VARIABLE) on line 7

I don't know what I did wrong, I'm new to PHP.

<?php

if(isset($_POST['submit'])){

    $subject="Music Form Submission"

    $name = $_POST['name'];
    $email = $_POST['email'];
    $number = $_POST['number'];
    $comments = $_POST['comments'];

    $emailTo = "main@skylightswebdesign.com";
    $headers = "From: ".$name;
    $txt = "You have received an e-mail from ".$name.".\n\n"."Phone number:".$number.".\n\n".$comments;

    mail($emailTo, $subject, $txt, $headers);
    header("Location: index.html?mailsend");

}

?>

1 Answers1

0

Missing semicolon at the end of the proceeding line of code PHP is throwing the error at.

$subject="Music Form Submission" 

should be

$subject="Music Form Submission";
dale landry
  • 7,831
  • 2
  • 16
  • 28