Search the Community
Showing results for tags 'echo email fields'.
-
Hi there, I've been following a great tutorial on youtube which has helped my understand a lot of what's going on in PHP forms but I cannot for the life of me get it to work properly. I've tested it online, it sends to my email address but it's either completely blank or comes up with the title of a single field. I've tried playing around with some variations a lot so it probably makes less sense than it did before. Can anyone help me? I'd really like to know where I'm going wrong and my brain hurts now! <?php $to = 'MYEMAILADDRESS (Yes I know, I've taken it out)'; $subject = 'Enquiry'; $model = $_POST['model']; $year = $_POST['year']; $info = $_POST['info']; $image = $_POST['image']; $name = $_POST['name']; $location = $_POST['location']; $number = $_POST['number']; $email = $_POST['email']; $message = <<<EMAIL $model $year $info $image $name $location $number $email EMAIL; $header = '$model'; if($_POST){ mail($to, $model, $year, $info, $image, $name, $location, $number,$email); $feedback = 'Thanks, we will get back to you shortly.'; } ?> <div id="form"> <p id="feedback"><?php echo $feedback; ?></p> <form action="?" method="post"> <ul> <li> <label for="model"> System Brand / Model:</label> <input type="text" name="model" id="model" /> </li> <li> <label for="year">Year Of Manufacturer:<br />(If Known)</label> <input type="text" name="year" id="year" /> </li> <li> <label for="info">Additional Information:</label> <textarea name="info" id="info"></textarea> </li> <li> <label for="image">Upload an Image:</label> <input name="image" type="file" id="image" /> </li> <li> <label for="name"> Clinic Name:</label> <input type="text" name="name" id="name" /> </li> <li> <label for="location">Location:</label> <input type="text" name="location" id="location" /> </li> <li> <label for="number">Contact Number:</label> <input type="text" name="number" id="number" /> </li> <li> <label for="email">Email Address:</label> <input type="text" name="email" id="email" /> </li> </ul> <input type="submit" name="submit" value="Send" /> </form> </div> Thanks!