Jump to content

Rolladome

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by Rolladome

  1. Hi I'm new to PHP but i scripted a contact form on my website that has all the normal fields name, email address etc. But the emails that i recieve from the form appear blank except for the field names so something like Name: Email: Message: Mailinglist: I've looked at the scripting and I can't see anything wrong can someone help me? This is the code: <?php /*Subject and Email Variables*/ $emailSubject = 'New Form Entry'; $webMaster = 'rolladome@btinternet.com'; /*Gathering Data Variables*/ $nameField = $_POST['name']; $emailField = $_POST['email']; $phoneField = $_POST['phone']; $messageField = $_POST['message']; $mailinglistField = $_POST['mailinglist']; $body = <<<EOD Name: $name <br> Email Address: $email <br> phone: $phone <br> Message: $message <br> Mailing List: $mailinglist EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /*Results Rendered as HTML*/ $theResults = <<<EOD <html> <head> <meta http-equiv="refresh" content="3;URL=http://www.rolladome.org.uk/contact.html"> <title>Message Sent!</title> <style type="text/css"> <!-- .style2 { font-size: medium; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; color: #000000; } --> </style> </head> <body> <p align="center" class="style2">Thank you for your interest, Your email will be answered very soon!</p> <p align="center" class="style2">you will be returned to the RollaDome Website in a few seconds....</p> </body> </html> EOD; echo "$theResults"; ?>
  2. just incase this will help when I preview the page on my laptop the html thank you message that appears after submit button is pressed looks like this Email:$email phone:$phone Message:$message Mailing List:$mailinglist EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /*Results Rendered as HTML*/ $theResults = << Thank you for your interest, Your email will be answered very soon! you will be returned to the RollaDome Website in a few seconds.... EOD; echo"$theResults"; ?> as you can see some of the php scripting is showing in the html but not all of it
  3. No that didn't work, its still has the error on the same line.
  4. Thats what I thought... I just don't understand why this error is happening... maybe I should just start from scratch
  5. I'm having trouble with some code I wrote for a contact form on the website www.rolladome.org.uk.... when i previewed the page in dreamweaver the PHP script could be seen in the results rendered page and I assumed it was my computer so I uploaded it to the site using FTP and this error keeps appearing Parse error: syntax error, unexpected $end in /home/rollado1/public_html/contactformprocess.php on line 61 the code I used is: <?php /*Subject and Email Variables*/ $emailSubject = 'New Form Entry'; $webMaster = 'rolladome@btinternet.com'; /*Gathering Data Variables*/ $nameField = $_POST['name']; $emailField = $_POST['email']; $phoneField = $_POST['phone']; $messageField = $_POST['message']; $mailinglistField = $_POST['mailinglist']; $body = <<<EOD <br><hr><br> Name: $name <br> Email: $email <br> Phone Number: $phone <br> Message: $message <br> Mailing List: $mailinglist<br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /*Results Rendered as HTML*/ $theResults = <<<EOD <html> <head> <title>Message Sent!</title> <meta http-equiv="refresh" content="3;URL=http://www.rolladome.org.uk/index.html"> <style type="text/css"> <!-- .style1 { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: large; color: #333333; } --> </style> </head> <body> <div align="center"> <p><img src="images/header.gif" width="246" height="114" alt="Logo" /></p> <p> </p> <p align="center" class="style1">Thank you for your interest, Your email will be answered very soon!</p> <p align="center" class="style1">you will be returned to the RollaDome Website in a few seconds....</p> <p> </p> </div> </body> </html> EOD; echo "$theResults"; ?> can anyone see any problems with the script..... Thanks in advance for your help!!
×
×
  • 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.