Jump to content

HTML/PHP Contact Form

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
franktechnology

franktechnology

    Newbie

  • Members
  • Pip
  • 2 posts
On my message section I would like to to go down to the second line once the users writing approaches the end of the box. Instead, it stays on a single line continuously forever. How can I fix this?

index.htm

<font color="#ffffff" font face="Arial" font size="2">Frank Technology</font>

<br>

<br>

<br>

<form method="POST" action="mailer.php">

<font color="#ffffff" font face="Arial" font size="2">Name: (Required)</font><br>

         <input type="text" name="name" size="25"><br>

         <br>

<font color="#ffffff" font face="Arial" font size="2">Email: (Required)</font><br>

         <input type="text" name="email" size="25"><br>

         <br>

<font color="#ffffff" font face="Arial" font size="2">Message: (Required)</font><br>

         <textarea rows="9" name="message" cols="50"></textarea>

         <br>

         <br>

         <input type="submit" value="Submit" name="submit">

</form>

<body bgcolor="#003366">


mailer.php

<?php


if(isset($_POST['submit'])) { 

$to = "john.frank@msn.com";

$subject = "Frank Technology";

$name_field = $_POST['name']; 

$email_field = $_POST['email'];

$message = $_POST['message']; 

  

$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message"; 

  

echo "Thank you for contacting us. We will get back to you shortly.";

mail($to, $subject, $body);

} else { 

echo "blarg!";

}

?>


Edited by Orjan, 21 August 2010 - 12:09 AM.


#2
Peter Kelly

Peter Kelly

    Newbie

  • Members
  • Pip
  • 5 posts
A simple way to solve this is by adding WRAP to the message field.

Change
<textarea rows="9" name="message" cols="50"></textarea>

To
<textarea rows="9" name="message" cols="50" wrap="ON"></textarea>

and that should solve it for you :)