Jump to content

Barsoj

New Members
  • Posts

    4
  • Joined

  • Last visited

Barsoj's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Guys, day three learning this language; did the tests and found the mistakes, thanks to you guys for pointing me the right direction. Thank you Cronix and Ch0cu3r! Here's my final working code: <?php $to = "1234@1234.co.uk"; $subject = "From Website Contact Form"; $first = $_REQUEST['first']; $last = $_REQUEST['last']; $email = $_REQUEST['email']; $phone = $_REQUEST['phone']; $MESSAGE_BODY .= "First name: " . $_POST["first"] . "\n"; $MESSAGE_BODY .= "Last name: " . $_POST["last"] . "\n"; $MESSAGE_BODY .= "Phone No: " . $_POST["phone"] . "\n"; $MESSAGE_BODY .= "Email: " . $_POST["email"] . "\n\n"; $MESSAGE_BODY .= "Message: " . nl2br($_POST["message"]) . "\n"; $from = $_REQUEST['email']; $headers = "From:" . $email; mail($to, $subject, $MESSAGE_BODY, $headers); echo "Your message has been sent"; ?> Awesome. Thanks again.
  2. Yes, it does work. Thank you.
  3. Hi everyone. Pretty desperate, first time that I'm working with php. Learning this language, makes sense, however I can't figure out why my code is not working. Emails are not coming in at all. Additional required info (phone number, first name, last name) should be included in the message. Please help. Thank you everyone. <?php $to = "abcd@abcd.com"; $subject = "From Website Contact Form"; $first = $_REQUEST['first']; $last = $_REQUEST['last']; $email = $_REQUEST['email']; $phone = $_REQUEST['phone']; $MESSAGE_BODY = "Name: " . $_POST["first"] . "\n"; $MESSAGE_BODY = "Name: " . $_POST["last"] . "\n"; $MESSAGE_BODY = "Contact No: " . $_POST["phone"] . "\n"; $MESSAGE_BODY = "Email: " . $_POST["email"] . "\n"; $MESSAGE_BODY = "Requirement: " . nl2br($_POST["message"]) . "\n"; $message = $_REQUEST['message' + 'email' + 'first' + 'last']; $from = $_REQUEST['email']; $headers = "From:" . $from; mail($to, $subject, $MESSAGE_BODY, $headers); echo "Your message has been sent"; ?>
×
×
  • 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.