Hi, im making the website for a local youth club, and the leader there, wants to have comments posted automatically, under the contact box.
I'm fine with the contact form, that works fine. Its the same one used on my website, its been tested by 3 other people to. The redirection works fine too.
I want to know how to send the results to a .txt file, so I can include them under the form.
<?php /* Subject and Email variables */ $emailSubject = 'Online Contact Form'; $webMaster = 'email@example.com'; /* Gathering data variables */ $name = $_POST['name']; $email = $_POST['email']; $comments = $_POST['comments']; $body = <<<EOD <br><hr><br> Name: $name <br> Email: $email <br> Comments: $comments <br> EOD; s $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results renderes as HTML */ $theResults = <<<EOD <html> <head> <title>Your Page Title</title> <meta http-equiv="REFRESH"content="0;url=http://www.wainscottyouthclub.org.uk"></HEAD> <BODY> Your message was sent successfully. You should be automaticly redirected to the home page.<br> It not, click <a href="http://www.wainscottyouthclub.org.uk" target="_self">here</a>. </BODY> </HTML> EOD; echo"$theResults"; ?>
Any help greatly appreciated!