/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<? // Get the message String $rawString = $_POST['comments']; // Split the string into pieces for processing // First element is the subject line $subject = $pieces[0]; // Take the array, delete the first entry, So we can pass it to $message // Replace the \n or add a <br /> if you like. echo "Subject: ". $subject; echo "<br />"; echo "Message: ". $message; ?> <form action="<? echo $_SERVER['php_self'] ?>" method="post"> <textarea id="comments" name="comments">Your message</textarea> <input name="send" type="submit" value="Send" /> </form>
URL: http://www.adampatterson.ca/blog/2010/09/php-handy-little-snippet-for-multiline-text-box/