Jump to content

Deutsch33

New Members
  • Posts

    1
  • Joined

  • Last visited

Deutsch33's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am new to programming/php. I've seen good and bad video resources of people trying to teach newcomers but it ends up not working in the end. Maybe it's on my server, maybe not. I am trying to get an html form to send email using php. I tried some video tutorials like, http://www.youtube.com/watch?v=z2cVERxjSRY and the persons code in the video always works yet when you try to do it on your server it comes up short. I kept getting this error after writing the code as it is shown. PHP Parse error: syntax error, unexpected T_IF in /*********/*********/public_html/test/support-send.php on line 2 Here is the php code: Line1: <?PHP> Line2: if (isset($_POST['submit'])) { Line3: $body = 'Name: ' .$_POST['name'] ."\n" Line4: .'Email: ' .$_POST['email'] ."\n" Line5: .'Message: ' .$_POST['message'] .; Line6: Line7: mail('myemail@mydomain.com', 'Contact Form', $body); Line8: header('location: contact-thank-you.php'); Line9: Line10: } else { Line11: header('location: contactform.php'); Line12: exit(0); Line13: } Line14: ?> Can anyone tell me what is going on in line2 or how I can make the email action work another way?
×
×
  • 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.