Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP Email Help

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #30789
    PeretzM
    Member

    Can anyone help me figure out why this php isnt working:



    $email = '
    ';
    $subject = '
    ';
    $message =
    "Name of School/Group: ".$_POST."
    Address: ".$_POST."
    City: ".$_POST."
    State: ".$_POST."
    Zip: ".$_POST."
    Contact Name: ".$_POST."
    Position: ".$_POST."
    Email Address: ".$_POST."
    Phone Number: ".$_POST."
    cell: ".$_POST."
    Group 1 Preference 1 Date: ".$_POST."
    Group 1 Preference 1 Time: ".$_POST."
    Group 1 Preference 2 Date: ".$_POST."
    Group 1 Preference 2 Time: ".$_POST."
    Group 1 Ages: ".$_POST."
    Group 1 Children: ".$_POST."
    Group 1 Teachers: ".$_POST."
    Group 2 Preference 1 Date: ".$_POST."
    Group 2 Preference 1 Time: ".$_POST."
    Group 2 Preference 2 Date: ".$_POST."
    Group 2 Preference 2 Time: ".$_POST."
    Group 2 Ages: ".$_POST."
    Group 2 Children: ".$_POST."
    Group 2 Teachers: ".$_POST."
    Group 3 Preference 1 Date: ".$_POST."
    Group 3 Preference 1 Time: ".$_POST."
    Group 3 Preference 2 Date: ".$_POST."
    Group 3 Preference 2 Time: ".$_POST."
    Group 3 Ages: ".$_POST."
    Group 3 Children: ".$_POST."
    Group 3 Teachers: ".$_POST."
    Comments: ".$_POST.";


    $headers = "MIME-Version: 1.0rn";

    if (mail($email,$subject,$message,$headers)) {
    header("location: onsubmit.html");
    }
    else {
    echo "Sorry, an error has occured, please try again.";
    }
    ?>

    The specific error I’m getting is:
    “Parse error: syntax error, unexpected T_STRING in /home/content/S/h/m/Shmulyg/html/sendmail.php on line 39”

    Thanks in advance!

    #67972
    cybershot
    Participant

    $emial = ”


    “;

    should probably read $email = “your email address”;
    $subject = ”


    “;

    you need to add a subject to between the quotes

    #67987
    TT_Mark
    Member

    It has nothing to do with what @cybershot says. You are simply leaving your ” open, something which should be quite obvious with syntax highlighting. The line

    Comments: ".$_POST.";

    should be

    Comments: ".$_POST;
    #68026
    clokey2k
    Participant

    I have stared at this code a few times myself. At no point did I see the reopened ” at the end…

    #67899
    PeretzM
    Member

    @TT_Mark Thanks, I never would have gotten that!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Back End’ is closed to new topics and replies.