Not sure how to fix this error?Line 11 is the $recipient =

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JakeMB
    New Member
    • Oct 2013
    • 2

    Not sure how to fix this error?Line 11 is the $recipient =

    ------------mail.php
    Code:
    <?php
    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $call = $_POST['call'];
    $website = $_POST['website'];
    $priority = $_POST['priority'];
    $type = $_POST['type'];
    $message = $_POST['message'];
    $formcontent=" From: $name \n Phone: $phone \n Call Back: $call \n Website: $website \n Priority: $priority \n Type: $type \n Message: $message";
    $recipient = "hwy9drum@gmail.com";
    
    $subject = "Contact Form";
    $mailheader = "From: $email \r\n";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
    echo "Thank You!";
    ?>
    --------------html------------form.html
    <p>Name</p> <input type="text" name="name">
    <p>Email</p> <input type="text" name="email">
    <p>Phone</p> <input type="text" name="phone">
    <p>Request Phone Call:</p>
    Yes:<input type="checkbox" value="Yes" name="call"><br />
    No:<input type="checkbox" value="No" name="call"><br />
    <p>Website</p> <input type="text" name="website">
    <p>Priority</p>
    <select name="priority" size="1">
    <option value="Low">Low</option>
    <option value="Normal">Normal</option>
    <option value="High">High</option>
    <option value="Emergency">Emergency</option>
    </select>
    <br />
    <p>Type</p>
    <select name="type" size="1">
    <option value="update">Website Update</option>
    <option value="change">Information Change</option>
    <option value="addition">Information Addition</option>
    <option value="new">New Products</option>
    </select>
    <br />
    <p>Message</p><textarea name="message" rows="6" cols="25"></textarea><br />
    <input type="submit" value="Send"><input type="reset" value="Clear">
    </form>
    Last edited by Rabbit; Oct 30 '13, 05:26 AM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
  • JakeMB
    New Member
    • Oct 2013
    • 2

    #2
    This is the error i get
    Parse error: syntax error, unexpected T_STRING in D:\Hosting\1155 \html\mail.php on line 11

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      I would stab a guess at that there’s a " in one of the variables from line #10, which invalidates the string definition on line #11.

      Comment

      Working...