Jump to content

yorkshirekid

New Members
  • Posts

    3
  • Joined

  • Last visited

yorkshirekid's Achievements

Newbie

Newbie (1/5)

0

Reputation

1

Community Answers

  1. Smarty pants . You nailed it Jacques1. Thank you. Asking me about the text field made me look to see and I had named it Comment instead of comment. That's intuition for you - something I lack; which is why I came to this forum. Again - many thanks. I'm going to learn how to use var_dump now. Cheers
  2. Ok thanks. The problem is as I outlined - that there is no comment received. Everything else is working - the name and email fields. I can put text in the comment box but it is blank when received. I don't understand the 'code questions' you ask. Yes, I'm reading and trying things from all over the place. I thought I'd give this email form a try and was pleased it went ok except the one part. I am just after a resolve for that part atm. I just thought an expereinced programmer may spot an error, sorry. Thanks for looking.
  3. Hello. I am very new to php. In fact I've used it once! I made a webpage and used some code I got off the net to and the comment part does not work - the rest does. I'd be grateful if somebody would help me fix it please. I want to use this code and not any other code please. Here it is: =================================== <?php //define variables that are same as Contact Form and give them null values $name = ""; $email = ""; $comment = ""; // if the submit button is clicked then please do the following... if (isset($_POST['submit'])) { // this function 'sanitises' the input data // gets rid of white space // changes none html characters to html characters // helps prevent potentioal injection by hacker function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; // run the function } // Takes input data and sends it to the function above and then posts the form if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = test_input ($_POST["name"]); $email = test_input ($_POST["email"]); $comment = test_input ($_POST["comment"]); } // Who is the form going to and what is the Subject $to = "[email protected]"; $subject = "Website Feedback"; } // Format how the message will be recieved $message ='Name: '.$name.'<br /><br />Email:'.$email.'<br /><br />Comment:'.$comment; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; mail($to, $subject,$message,$headers); ?> ====================================
×
×
  • 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.