• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

simple email form

Can you guys give me a simple email form with name, email, comments, clear button,and submit button.

Also, I would like it to use the "Location" command to send the email to http://owndesigns.com/bob/local-boise/contact.html

Thanks in advanced,

Bob
{ Removed by Diablo84 - PHP Page Editor }
0
weikelbob
Asked:
weikelbob
2 Solutions
 
PromethylCommented:
<form method=post name=frm1 action=?>
<input type=text name=name value="">
<input type=text name=email value="">
<input type=text name=comments value="">
<input type=Reset name=name value="Submit!">
<input type=Submit name=name value="Clear!">
</form>
<?
if ($_POST) {
   $m = "New email:\n\n";
   foreach($_POST as $k=>$v) {
       $m.="$k : $v\n";
   }
mail ("youremail@email.com","New Form Submission!",$m);
}
?>
0
 
edyonlineCommented:
<?php

$to = "your@emailaddress.com";

if (isset($_POST['message']))
{
  $message = $_POST['message'];
  $from = $_POST['from'];
  $fromemail = $_POST['fromemail'];
  $headers = 'From: ' . $from . ' <' . $fromemail . ">\r\n";
  $headers .= 'Reply-To: <' . $fromemail . ">\r\n";
  $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";

  mail($to, "Form submitted from your website", $message,$header);


}

?>
<form method=post action="<? echo "$PHP_SELF"; ?>">
<b>Your name:</b><br>
<input type="text" name="from" size="27">
<p>

<b>Your Email:</b><br>
<input type="text" name="fromemail" size="27">
<p>
<p>

<b>Please add any comments you have below:</b>
<br>
<textarea cols="40" rows="10" name="message"></textarea>

<p><br>
<input type="submit" value="Send">
<input type="reset" value="Clear the form">
</form>
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now