View Full Version : Creating a feedback form.
aggierecruiter
05-04-2003, 08:05 AM
Hello,
I was wondering if I could get some advice on how to create a feedback form for my organization website using PHP coding? If anybody has any tips, I would love to hear from you.
Things I want to include are:
Name
Location
E-mail Address
URL (optional)
Comments
mouse
05-04-2003, 09:41 AM
IF you want the feedback emailed to you, then you want the mail() (http://php.net/mail) function, something along the lines of this:<form action="<?PHP echo $PHP_SELF ?>" method="post">
<p>Name: <input type="text" name="name"></input></p>
<p>Location<input type="text" name="location"></input></p>
<p>E-mail<input type="text" name="email"></input></p>
<p>Url<input type="text" name="url"></input></p>
<p>Comments<textarea rows="20" cols="70" name="comments"></textarea></p>
<p><input type="submit" name="submit"></input></p>
</form>
<?
/* recipients */
$to = "You <your@emailaddress.com>" ;
/* subject */
$subject = "Feedback";
$content = stripslashes($comments);
/* message */
$message = "$name </br> $location </br> $email </br> $url </br> $content";
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Feedback <feedback@domain.com>\r\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
?>
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.