Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

php mail form


  • Please log in to reply

#16
knexor2

knexor2

    Member

  • Member
  • PipPip
  • 28 posts
Oops, I forgot the submit button in my original sample form. For a submit button, you just need <input type=submit value=Submit> between your form tags. Also, make sure you had an action in your opening form tag, targeting a php script to handle the form contents and send the email:

<!-- Sample form -->
<form name="myform" action="processing_script.php" method="post">
<input type="hidden" name="submitted" value="true">
<table>
<tr>
<td><input type="radio" name="vehicle" value="car">Car
<td><input type="radio" name="vehicle" value="truck">Truck
<td><input type="radio" name="vehicle" value="van">Van
<tr>
<td colspan=3>Email:<input type="text" name="email">
<tr>
<td><input type="checkbox" name="drive">Drive
<td><input type="checkbox" name="ride">Ride
<td>&nbsp;
<tr>
<td><input type="submit" value="Send Mail">
<td>
<td><input type="reset" value="Reset">
</table>
</form>


Also, if you are using someone else's server (a free host or something), you may not have the mail() function enabled. You may be able to contact your host support and request that this feature be enabled for your domain/subdomain.

$body = "$check1 was checked\n(radio buttons' name): $radio\nComments: $comments";

$check1, $radio, and $comments are the values of the form elements (the checkbox, with name check1; the radio button group, with name of radio; and the comments textarea, with name of comments). These variables are automatically expanded to their values when used in double quotes. The \n is the newline character.

If you would like me to just write you a form and processing script, PM me with your requirements.
  • 0

Advertisements


#17
TaNkZ101

TaNkZ101

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 327 posts
i thank you all for your help you've been very patient and understanding, expecially knexor2!
i've now learned some of the basic functions of php and how it works, which was my primary goal!
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP