herrpoon
January 26th, 2006, 06:19 PM
Hi, I'm trying to set up an email contact form on my "website" so that people can contact me without my address getting added to some spam database or something. Having googled around I've got the basics, i.e. the form, how to send it etc. but am beginning to get a bit stuck. This is what I've got so far:
<form action="process.php" method="post">
Name: <input type="text" name="name" size="20" maxlength="20" /><br />
Email: <input type="text" name="email" size="30" maxlength="30" /><br />
Subject: <input type="text" name="subject" size="30" maxlength="30" /><br />
Text:<textarea name="text" name="text" cols="50" rows="10"></textarea><br />
<input type="submit" name="submit" value="Send" />
</form>
So that's all fine and dandy and I've got the process.php here:
<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$text = stripslashes($text);
mail('myemailaddresshere',$subject,$text,"From: $name <$email>");
header("location:form.php");
?>
But what I want to do is add two more categories to the form.html, e.g.,
Business: <input type="text" name="business" size="30" maxlength="30" /><br />
Attention:<br />
<select name="attn" size="1">
<option value=" Sales ">Sales n Billing </option>
<option value=" General Support ">General Support </option>
<option value=" Technical Support ">Technical Support </option>
<option value=" Webmaster ">Webmaster </option>
</select> <br />
and have the results, i.e. Business = whatever
Attention = Sales etc. etc.
in the body of the email along with the message. As I said, I've tried googling it but I can't come up with anything that actaully works. Thanks for any help, I'm really at a dead end here :(
<form action="process.php" method="post">
Name: <input type="text" name="name" size="20" maxlength="20" /><br />
Email: <input type="text" name="email" size="30" maxlength="30" /><br />
Subject: <input type="text" name="subject" size="30" maxlength="30" /><br />
Text:<textarea name="text" name="text" cols="50" rows="10"></textarea><br />
<input type="submit" name="submit" value="Send" />
</form>
So that's all fine and dandy and I've got the process.php here:
<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$text = stripslashes($text);
mail('myemailaddresshere',$subject,$text,"From: $name <$email>");
header("location:form.php");
?>
But what I want to do is add two more categories to the form.html, e.g.,
Business: <input type="text" name="business" size="30" maxlength="30" /><br />
Attention:<br />
<select name="attn" size="1">
<option value=" Sales ">Sales n Billing </option>
<option value=" General Support ">General Support </option>
<option value=" Technical Support ">Technical Support </option>
<option value=" Webmaster ">Webmaster </option>
</select> <br />
and have the results, i.e. Business = whatever
Attention = Sales etc. etc.
in the body of the email along with the message. As I said, I've tried googling it but I can't come up with anything that actaully works. Thanks for any help, I'm really at a dead end here :(