Simple HTML + php mail form / need help!

the mail() function

Moderators: macek, egami, gesf

ericcity
New php-forum User
New php-forum User
Posts: 1
Joined: Thu Aug 23, 2012 9:20 am

Simple HTML + php mail form / need help!

Postby ericcity » Thu Aug 23, 2012 9:25 am

Hey guys.

I have this html form and i need to figure out how to write the .php file to send this information to an email. there are quite a few variables (as seen on the profiler link) and I'm not sure how i would put all of this into the php file.

i tried to write a contact.php file, then place that call to action in the form code on the html document (not seen below)

Please, any help would be greatly appreciated, as i need to get this done asap.

www.doneyourway.ca/profiler

Cheers,
Eric




<html>
<head>
</head>
<body><div name="formerror"></div><div align="center">
<blockquote>READ CAREFULLY: In the three columns below, there are 8 four-word groups.<br>
Select two words in each group; one which is MOST like you and one which is LEAST like you.<br>
<font color="#ff0000"><b><u>DO NOT</u></b> select the same word that is MOST & LEAST like you.</font>
</blockquote><br>
<table summary="" border="0">
<tr>
<td></td>
<td><b><font color="#ff0000">EXAMPLE</font></b></td>
<td>&nbsp;M</td>
<td>&nbsp;L</td>
</tr>
<tr>
<td align="left" valign="top"></td>
<td>AUTOCRATIC<br>CONGENIAL<br>STABLE<br>EXACTING<p></td>
<td>
<input type="radio" name="0x1M" value="AUTOCRATIC-SAMPLE-M" disabled checked><br>
<input type="radio" name="0x1M" value="CONGENIAL-SAMPLE-M" disabled><br>
<input type="radio" name="0x1M" value="STABLE-SAMPLE-M" disabled><br>
<input type="radio" name="0x1M" value="EXACTING-SAMPLE-M" disabled><p>
</td>
<td>
<input type="radio" name="0x1L" value="AUTOCRATIC-SAMPLE-M" disabled><br>
<input type="radio" name="0x1L" value="CONGENIAL-SAMPLE-M" disabled><br>
<input type="radio" name="0x1L" value="STABLE-SAMPLE-M" disabled checked><br>
<input type="radio" name="0x1L" value="EXACTING-SAMPLE-M" disabled><p>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>

<form name='test' method='POST' action='' accept-charset='UTF-8'>
<div align="center">
Name: <input type='text' value='' id='Name' name='Name' size='40'><br>
Email: <input type='text' value='' id='Email' name='Email' size='40'><br>
Contact #: <input type='text' value='' id='Contact' name='Contact' size='15'><br>
<table>
<tr>
<td><u>Group 1</u></td>
<td>
&nbsp;M
</td>
<td>
&nbsp;L
</td>
<td><u>Group 2</u></td>
<td>
&nbsp;M
</td>
<td>
&nbsp;L
</td>
<td><u>Group 3</u></td>
<td>
&nbsp;M
</td>
<td>
&nbsp;L
</td>
</tr>
<tr>
<td>EXPRESSIVE<br>COMPLIANT<br>FORCEFUL<br>RESTRAINED<p></td>
<td>
<input type="radio" name="Group1-Most" value="MI" ><br>
<input type="radio" name="Group1-Most" value="MC" ><br>
<input type="radio" name="Group1-Most" value="MD" ><br>
<input type="radio" name="Group1-Most" value="MS" ><p>
</td>
<td>
<input type="radio" name="Group1-Least" value="LI" ><br>
<input type="radio" name="Group1-Least" value="LC" ><br>
<input type="radio" name="Group1-Least" value="LD" ><br>
<input type="radio" name="Group1-Least" value="LS" ><p>
</td>
<td>HIGHSPIRITED<br>TALKATIVE<br>GOOD NATURED<br>SOFTSPOKEN<p></td>
<td>
<input type="radio" name="Group2-Most" value="MD" ><br>
<input type="radio" name="Group2-Most" value="MI" ><br>
<input type="radio" name="Group2-Most" value="MS" ><br>
<input type="radio" name="Group2-Most" value="MC" ><p>
</td>
<td>
<input type="radio" name="Group2-Least" value="LD" ><br>
<input type="radio" name="Group2-Least" value="LI" ><br>
<input type="radio" name="Group2-Least" value="LS" ><br>
<input type="radio" name="Group2-Least" value="LC" ><p>
</td>
<td>ADVENTUROUS<br>ENTHUSIASTIC<br>ADAPTABLE<br>LOYAL<p></td>
<td>
<input type="radio" name="Group3-Most" value="MD" ><br>
<input type="radio" name="Group3-Most" value="MI" ><br>
<input type="radio" name="Group3-Most" value="MC" ><br>
<input type="radio" name="Group3-Most" value="MS" ><p>
</td>
<td>
<input type="radio" name="Group3-Least" value="LD" ><br>
<input type="radio" name="Group3-Least" value="LI" ><br>
<input type="radio" name="Group3-Least" value="LC" ><br>
<input type="radio" name="Group3-Least" value="LS" ><p>
</td>
</tr>
<tr>
<td><u>Group 4</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 5</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 6</u></td>
<td>

</td>
<td>

</td>
</tr>
<tr>
<td>STRONG MINDED<br>CAREFUL<br>EMOTIONAL<br>SATISFIED<p></td>
<td>
<input type="radio" name="Group4-Most" value="MD" ><br>
<input type="radio" name="Group4-Most" value="MC" ><br>
<input type="radio" name="Group4-Most" value="MI" ><br>
<input type="radio" name="Group4-Most" value="MS" ><p>
</td>
<td>
<input type="radio" name="Group4-Least" value="LD" ><br>
<input type="radio" name="Group4-Least" value="LC" ><br>
<input type="radio" name="Group4-Least" value="LI" ><br>
<input type="radio" name="Group4-Least" value="LS" ><p>
</td>
<td>CONTENTED<br>IMPATIENT<br>CONVINCING<br>RESIGNED<p></td>
<td>
<input type="radio" name="Group5-Most" value="MS" ><br>
<input type="radio" name="Group5-Most" value="MD" ><br>
<input type="radio" name="Group5-Most" value="MI" ><br>
<input type="radio" name="Group5-Most" value="MC" ><p>
</td>
<td>
<input type="radio" name="Group5-Least" value="LS" ><br>
<input type="radio" name="Group5-Least" value="LD" ><br>
<input type="radio" name="Group5-Least" value="LI" ><br>
<input type="radio" name="Group5-Least" value="LC" ><p>
</td>
<td>HUMBLE<br>GOOD LISTENER<br>ENTERTAINING<br>WILL POWER<p></td>
<td>
<input type="radio" name="Group6-Most" value="MC" ><br>
<input type="radio" name="Group6-Most" value="MS" ><br>
<input type="radio" name="Group6-Most" value="MI" ><br>
<input type="radio" name="Group6-Most" value="MD" ><p>
</td>
<td>
<input type="radio" name="Group6-Least" value="LC" ><br>
<input type="radio" name="Group6-Least" value="LS" ><br>
<input type="radio" name="Group6-Least" value="LI" ><br>
<input type="radio" name="Group6-Least" value="LD" ><p>
</td>
</tr>
<tr>
<td><u>Group 7</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 8</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 9</u></td>
<td>

</td>
<td>

</td>
</tr>
<tr>
<td>CORRECT<br>PIONEERING<br>EASY MARK<br>INFLUENTIAL<p></td>
<td>
<input type="radio" name="Group7-Most" value="MC" ><br>
<input type="radio" name="Group7-Most" value="MD" ><br>
<input type="radio" name="Group7-Most" value="MS" ><br>
<input type="radio" name="Group7-Most" value="MI" ><p>
</td>
<td>
<input type="radio" name="Group7-Least" value="LC" ><br>
<input type="radio" name="Group7-Least" value="LD" ><br>
<input type="radio" name="Group7-Least" value="LS" ><br>
<input type="radio" name="Group7-Least" value="LI" ><p>
</td>
<td>RESPECTFUL<br>GOOD MIXER<br>AGGRESSIVE<br>GENTLE<p></td>
<td>
<input type="radio" name="Group8-Most" value="MC" ><br>
<input type="radio" name="Group8-Most" value="MI" ><br>
<input type="radio" name="Group8-Most" value="MD" ><br>
<input type="radio" name="Group8-Most" value="MS" ><p>
</td>
<td>
<input type="radio" name="Group8-Least" value="LC" ><br>
<input type="radio" name="Group8-Least" value="LI" ><br>
<input type="radio" name="Group8-Least" value="LD" ><br>
<input type="radio" name="Group8-Least" value="LS" ><p>
</td>
<td>LIFE-OF-THE-PARTY<br>OBEDIENT<br>TOLERANT<br>COMPETITIVE<p></td>
<td>
<input type="radio" name="Group9-Most" value="MI" ><br>
<input type="radio" name="Group9-Most" value="MS" ><br>
<input type="radio" name="Group9-Most" value="MC" ><br>
<input type="radio" name="Group9-Most" value="MD" ><p>
</td>
<td>
<input type="radio" name="Group9-Least" value="LI" ><br>
<input type="radio" name="Group9-Least" value="LS" ><br>
<input type="radio" name="Group9-Least" value="LC" ><br>
<input type="radio" name="Group9-Least" value="LD" ><p>
</td>
</tr>
<tr>
<td><u>Group 10</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 11</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 12</u></td>
<td>

</td>
<td>

</td>
</tr>
<tr>
<td>PRECISE<br>DOMINEERING<br>WILLING<br>ATTRACTIVE<p></td>
<td>
<input type="radio" name="Group10-Most" value="MC" ><br>
<input type="radio" name="Group10-Most" value="MD" ><br>
<input type="radio" name="Group10-Most" value="MS" ><br>
<input type="radio" name="Group10-Most" value="MI" ><p>
</td>
<td>
<input type="radio" name="Group10-Least" value="LC" ><br>
<input type="radio" name="Group10-Least" value="LD" ><br>
<input type="radio" name="Group10-Least" value="LS" ><br>
<input type="radio" name="Group10-Least" value="LI" ><p>
</td>
<td>POISED<br>CONVENTIONAL<br>NERVY<br>ACCOMMODATING<p></td>
<td>
<input type="radio" name="Group11-Most" value="MI" ><br>
<input type="radio" name="Group11-Most" value="MC" ><br>
<input type="radio" name="Group11-Most" value="MD" ><br>
<input type="radio" name="Group11-Most" value="MS" ><p>
</td>
<td>
<input type="radio" name="Group11-Least" value="LI" ><br>
<input type="radio" name="Group11-Least" value="LC" ><br>
<input type="radio" name="Group11-Least" value="LD" ><br>
<input type="radio" name="Group11-Least" value="LS" ><p>
</td>
<td>CAUTIOUS<br>NEIGHBORLY<br>VIGOROUS<br>PERSUASIVE<p></td>
<td>
<input type="radio" name="Group12-Most" value="MC" ><br>
<input type="radio" name="Group12-Most" value="MS" ><br>
<input type="radio" name="Group12-Most" value="MD" ><br>
<input type="radio" name="Group12-Most" value="MI" ><p>
</td>
<td>
<input type="radio" name="Group12-Least" value="LC" ><br>
<input type="radio" name="Group12-Least" value="LS" ><br>
<input type="radio" name="Group12-Least" value="LD" ><br>
<input type="radio" name="Group12-Least" value="LI" ><p>
</td>
</tr>
<tr>
<td><u>Group 13</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 14</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 15</u></td>
<td>

</td>
<td>

</td>
</tr>
<tr>
<td>EVEN TEMPERED<br>STIMULATING<br>FUSSY<br>DETERMINED<p></td>
<td>
<input type="radio" name="Group13-Most" value="MS" ><br>
<input type="radio" name="Group13-Most" value="MI" ><br>
<input type="radio" name="Group13-Most" value="MC" ><br>
<input type="radio" name="Group13-Most" value="MD" ><p>
</td>
<td>
<input type="radio" name="Group13-Least" value="LS" ><br>
<input type="radio" name="Group13-Least" value="LI" ><br>
<input type="radio" name="Group13-Least" value="LC" ><br>
<input type="radio" name="Group13-Least" value="LD" ><p>
</td>
<td>CONFIDENT<br>COOPERATIVE<br>ARGUMENTATIVE<br>RELAXED<p></td>
<td>
<input type="radio" name="Group14-Most" value="MI" ><br>
<input type="radio" name="Group14-Most" value="MC" ><br>
<input type="radio" name="Group14-Most" value="MD" ><br>
<input type="radio" name="Group14-Most" value="MS" ><p>
</td>
<td>
<input type="radio" name="Group14-Least" value="LI" ><br>
<input type="radio" name="Group14-Least" value="LC" ><br>
<input type="radio" name="Group14-Least" value="LD" ><br>
<input type="radio" name="Group14-Least" value="LS" ><p>
</td>
<td>RESERVED<br>OUTSPOKEN<br>STRICT<br>ELOQUENT<p></td>
<td>
<input type="radio" name="Group15-Most" value="MS" ><br>
<input type="radio" name="Group15-Most" value="MD" ><br>
<input type="radio" name="Group15-Most" value="MC" ><br>
<input type="radio" name="Group15-Most" value="MI" ><p>
</td>
<td>
<input type="radio" name="Group15-Least" value="LS" ><br>
<input type="radio" name="Group15-Least" value="LD" ><br>
<input type="radio" name="Group15-Least" value="LC" ><br>
<input type="radio" name="Group15-Least" value="LI" ><p>
</td>
</tr>
<tr>
<td><u>Group 16</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 17</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 18</u></td>
<td>

</td>
<td>

</td>
</tr>
<tr>
<td>TIMID<br>DEMANDING<br>PATIENT<br>CAPTIVATING<p></td>
<td>
<input type="radio" name="Group16-Most" value="MC" ><br>
<input type="radio" name="Group16-Most" value="MD" ><br>
<input type="radio" name="Group16-Most" value="MS" ><br>
<input type="radio" name="Group16-Most" value="MI" ><p>
</td>
<td>
<input type="radio" name="Group16-Least" value="LC" ><br>
<input type="radio" name="Group16-Least" value="LD" ><br>
<input type="radio" name="Group16-Least" value="LS" ><br>
<input type="radio" name="Group16-Least" value="LI" ><p>
</td>
<td>RESTLESS<br>WELL DISCIPLINED<br>INSPIRING<br>CONSIDERATE<p></td>
<td>
<input type="radio" name="Group17-Most" value="MD" ><br>
<input type="radio" name="Group17-Most" value="MC" ><br>
<input type="radio" name="Group17-Most" value="MI" ><br>
<input type="radio" name="Group17-Most" value="MS" ><p>
</td>
<td>
<input type="radio" name="Group17-Least" value="LD" ><br>
<input type="radio" name="Group17-Least" value="LC" ><br>
<input type="radio" name="Group17-Least" value="LI" ><br>
<input type="radio" name="Group17-Least" value="LS" ><p>
</td>
<td>OBLIGING<br>ANIMATED<br>DOGGED<br>DEVOUT<p></td>
<td>
<input type="radio" name="Group18-Most" value="MS" ><br>
<input type="radio" name="Group18-Most" value="MI" ><br>
<input type="radio" name="Group18-Most" value="MD" ><br>
<input type="radio" name="Group18-Most" value="MC" ><p>
</td>
<td>
<input type="radio" name="Group18-Least" value="LS" ><br>
<input type="radio" name="Group18-Least" value="LI" ><br>
<input type="radio" name="Group18-Least" value="LD" ><br>
<input type="radio" name="Group18-Least" value="LC" ><p>
</td>
</tr>
<tr>
<td><u>Group 19</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 20</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 21</u></td>
<td>

</td>
<td>

</td>
</tr>
<tr>
<td>OPEN MINDED<br>COMPANIONABLE<br>KIND<br>SELF-RELIANT<p></td>
<td>
<input type="radio" name="Group19-Most" value="MC" ><br>
<input type="radio" name="Group19-Most" value="MI" ><br>
<input type="radio" name="Group19-Most" value="MS" ><br>
<input type="radio" name="Group19-Most" value="MD" ><p>
</td>
<td>
<input type="radio" name="Group19-Least" value="LC" ><br>
<input type="radio" name="Group19-Least" value="LI" ><br>
<input type="radio" name="Group19-Least" value="LS" ><br>
<input type="radio" name="Group19-Least" value="LD" ><p>
</td>
<td>DIPLOMATIC<br>COURAGEOUS<br>SYMPATHETIC<br>OPTIMISTIC<p></td>
<td>
<input type="radio" name="Group20-Most" value="MC" ><br>
<input type="radio" name="Group20-Most" value="MD" ><br>
<input type="radio" name="Group20-Most" value="MS" ><br>
<input type="radio" name="Group20-Most" value="MI" ><p>
</td>
<td>
<input type="radio" name="Group20-Least" value="LC" ><br>
<input type="radio" name="Group20-Least" value="LD" ><br>
<input type="radio" name="Group20-Least" value="LS" ><br>
<input type="radio" name="Group20-Least" value="LI" ><p>
</td>
<td>ASSERTIVE<br>GREGARIOUS<br>NONCHALANT<br>DOCILE<p></td>
<td>
<input type="radio" name="Group21-Most" value="MD" ><br>
<input type="radio" name="Group21-Most" value="MI" ><br>
<input type="radio" name="Group21-Most" value="MS" ><br>
<input type="radio" name="Group21-Most" value="MC" ><p>
</td>
<td>
<input type="radio" name="Group21-Least" value="LD" ><br>
<input type="radio" name="Group21-Least" value="LI" ><br>
<input type="radio" name="Group21-Least" value="LS" ><br>
<input type="radio" name="Group21-Least" value="LC" ><p>
</td>
</tr>
<tr>
<td><u>Group 22</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 23</u></td>
<td>

</td>
<td>

</td>
<td><u>Group 24</u></td>
<td>

</td>
<td>

</td>
</tr>
<tr>
<td>AGREEABLE<br>SELF-CONTROLLED<br>PLAYFUL<br>PERSISTENT<p></td>
<td>
<input type="radio" name="Group22-Most" value="MC" ><br>
<input type="radio" name="Group22-Most" value="MS" ><br>
<input type="radio" name="Group22-Most" value="MI" ><br>
<input type="radio" name="Group22-Most" value="MD" ><p>
</td>
<td>
<input type="radio" name="Group22-Least" value="LC" ><br>
<input type="radio" name="Group22-Least" value="LS" ><br>
<input type="radio" name="Group22-Least" value="LI" ><br>
<input type="radio" name="Group22-Least" value="LD" ><p>
</td>
<td>EAGER<br>POSITIVE<br>LENIENT<br>EXACTING<p></td>
<td>
<input type="radio" name="Group23-Most" value="MI" ><br>
<input type="radio" name="Group23-Most" value="MD" ><br>
<input type="radio" name="Group23-Most" value="MS" ><br>
<input type="radio" name="Group23-Most" value="MC" ><p>
</td>
<td>
<input type="radio" name="Group23-Least" value="LI" ><br>
<input type="radio" name="Group23-Least" value="LD" ><br>
<input type="radio" name="Group23-Least" value="LS" ><br>
<input type="radio" name="Group23-Least" value="LC" ><p>
</td>
<td>OUTGOING<br>BOLD<br>MODERATE<br>PERFECTIONIST<p></td>
<td>
<input type="radio" name="Group24-Most" value="MI" ><br>
<input type="radio" name="Group24-Most" value="MD" ><br>
<input type="radio" name="Group24-Most" value="MS" ><br>
<input type="radio" name="Group24-Most" value="MC" ><p>
</td>
<td>
<input type="radio" name="Group24-Least" value="LI" ><br>
<input type="radio" name="Group24-Least" value="LD" ><br>
<input type="radio" name="Group24-Least" value="LS" ><br>
<input type="radio" name="Group24-Least" value="LC" ><p>
</td>
</tr>
</table>
<input type='submit' name='Submit' value='Submit'>
</form>
</body>
</html>

ranito80
New php-forum User
New php-forum User
Posts: 2
Joined: Sat Aug 25, 2012 10:38 am
Location: St. Louis, MO

Re: Simple HTML + php mail form / need help!

Postby ranito80 » Sat Aug 25, 2012 10:54 am

Your code doesn't tell the form what to do with the information it gathers because you have nothing designated as the 'action' in the form where it reads:

<form name='test' method='POST' action=''

So you must put an action file between the quotes. For example it ought to say something like:

<form name='test' method='POST' action='sendmail.php'

You, of course, must write the sendmail.php script as well.

swarndeep
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Sep 03, 2012 4:38 am
Contact:

Re: Simple HTML + php mail form / need help!

Postby swarndeep » Mon Sep 03, 2012 4:45 am

write as

<form name='test' method='POST' action='sendmail.php' >

swarndeep
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Sep 03, 2012 4:38 am
Contact:

Re: Simple HTML + php mail form / need help!

Postby swarndeep » Mon Sep 03, 2012 4:47 am

write as

<form name='test' method='POST' action='sendmail.php' >

http://webexperttips.com

phpdevelopers
New php-forum User
New php-forum User
Posts: 7
Joined: Wed May 16, 2012 12:49 am
Contact:

Re: Simple HTML + php mail form / need help!

Postby phpdevelopers » Wed Sep 26, 2012 10:45 pm

Thanks for contributing!


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 2 guests