random1 Posted March 11, 2008 Share Posted March 11, 2008 Hi All, I have the following code and it is sending an email but not allowing multiple lines in the <textarea>. It dies on submition of the form when the text area contains more than one line (is it because of %0D%?). How can this issue be fixed? e.g. http://www.example.com.au/product_info.php?field_name=Test&field_email=test%40test.com&field_message=test1%0D%0A2%0D%0A3%0D%0A4&button_send=Send+Query&tester=test356645667&formcontact=Yes Logic Code: <?php if($_REQUEST['formcontact'] == "Yes") { $domain = "http://www.example.com.au"; // Must be changed to actual domain $destinationemail = "test@example.com.au"; // Must be changed to actual company email $name = $_REQUEST['field_name']; $email = $_REQUEST['field_email']; $message = $_REQUEST['field_message']; if($email != "" && $name != "" && $message != "") { $outputmessage = "<p>$name has sent an email from the TEST ONLY website.</p>". "<p>$name's email is $email.</p>". "<p>$name's query:</p>". "<p>$message</p>"; // The formatted message mail( $destinationemail, "TEST Website Contact Form Result - $name", $outputmessage, "From: $email\nReply-To: $email\nContent-Type: text/html" ); $formstatus = "Sent"; } else { $formstatus = "Failed"; } } ?> Form Code: <form action="<?php echo $_SERVER['PHP_SELF'];?>" name="form_message" id="form_message"> <div style="text-align:left; align:left; margin-left:6px;"> <label>Full Name:*</label><br /> <input type="text" name="field_name" value="<?php echo $name ?>" size="25" id="field_name" /><br /> <label>Email:*</label><br /> <input type="text"id="field_email" value="<?php echo $email ?>" size="25" name="field_email" /><br /> <label>Your Query:*</label><br /> <textarea style="align:left;" name="field_message" cols="25" rows="3" id="field_message"><?php echo $message ?></textarea><br /> <input type="submit" value="Send Query" id="button_send" name="button_send" /> <input type="hidden" id="tester" name="tester" value="test356645667" /> <input type="hidden" id="formcontact" name="formcontact" value="Yes" /> </div> </form> Quote Link to comment Share on other sites More sharing options...
MikeL Posted March 11, 2008 Share Posted March 11, 2008 oops nevermind Quote Link to comment Share on other sites More sharing options...
random1 Posted March 14, 2008 Author Share Posted March 14, 2008 Nobody knows how to use multi lines in a $_REQUEST object? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.