Link to home
Start Free TrialLog in
Avatar of andrewl77
andrewl77

asked on

Help creating a web form that emails the info

I have created a contacts form.  When they click submit i want the information emailed to an email address.  The code of the form looks likes this:

                    <form name="form1" method="post" action="">
                      <table width="450" border="0" align="center">
                        <tr>
                          <td width="120">Contact Name: </td>
                          <td width="320"><input name="conname" type="text" id="conname" size="50"></td>
                        </tr>
                        <tr>
                          <td>Address:</td>
                          <td><input name="conadd" type="text" id="conadd" value="" size="50"></td>
                        </tr>
                        <tr>
                          <td>Email:</td>
                          <td><input name="email" type="text" id="email" size="60"></td>
                        </tr>
                        <tr>
                          <td>Phone:</td>
                          <td><input name="phone" type="text" id="phone" size="30"></td>
                        </tr>
                        <tr>
                          <td>Mobile:</td>
                          <td><input name="phone2" type="text" id="phone2" size="30"></td>
                        </tr>
                        <tr>
                          <td>Areas of Interest: </td>
                          <td><table width="390" border="0">
                              <tr>
                                <td class="style4"><div align="center" class="style17">
                                    <input type="checkbox" name="checkbox" value="checkbox">
                                  Modelling </div></td>
                                <td class="style4"><div align="center" class="style17">
                                    <input type="checkbox" name="checkbox2" value="checkbox">
                                  Acting</div></td>
                                <td class="style4"><div align="center" class="style17">
                                    <input type="checkbox" name="checkbox3" value="checkbox">
                                  Photography</div></td>
                              </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td colspan="2"><div align="center">About your Child </div></td>
                        </tr>
                        <tr>
                          <td>Name:</td>
                          <td><input name="conname2" type="text" id="conname2" size="50"></td>
                        </tr>
                        <tr>
                          <td>Gender:</td>
                          <td><select name="select">
                              <option>Male</option>
                              <option>Female</option>
                            </select>
                          </td>
                        </tr>
                        <tr>
                          <td>Age:</td>
                          <td><input name="phone22" type="text" id="phone22" size="15"></td>
                        </tr>
                        <tr>
                          <td>General Information </td>
                          <td><textarea name="textarea" cols="50" rows="3"></textarea></td>
                        </tr>
                        <tr>
                          <td colspan="2"><div align="center">
                              <label>
                              <input type="submit" name="Submit2" value="Submit">
                              </label>
                          </div></td>
                        </tr>
                      </table>
                    </form>

How do i change this form to email the form information to an email address when the submit button is clicked?

Avatar of Rouchie
Rouchie
Flag of United Kingdom of Great Britain and Northern Ireland image

You need a server-side language to do this (i.e. ASP, PHP, ASP.NET etc).  Can you tell us which language your server is configured to support?
Avatar of andrewl77
andrewl77

ASKER

The page is php....and server supports php.
In that case you'd better wait for Jason to start work, as I'm your man for ASP.... ;-)  Sorry!
Thats okay...what time/how long before that?  I am in melbourne and it is 11:30 pm!!!
He's usually on around now, so shouldn't be long.  I *think* he's in LA (USA).
There are plenty of form processors out there.  Check out any one of these:  http://www.hotscripts.com/PHP/Scripts_and_Programs/Form_Processors/index.html
ASKER CERTIFIED SOLUTION
Avatar of klykken
klykken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jason C. Levine
Good morning.  For the record, I am in L.A. but I don't do early...

Hi andrewl77,

fuzzboxer and klykken both give good advice.  For some weird reason, Dreamweaver does not have an included form-to-email behavior, so you have to go third party.  While there are specific DW extensions out there to do this, they are generally paid extensions and not worth it when you consider how easy it is to do this.

klykken's link shows just how easy it is.  I would attempt to run with that tutorial and post back if you have questions

j
I have used Klykken's and yep...it was simple!

My only other question is how do i reformat the output into something pretty?

Results from form:

conname:              Andrew Little
conadd:               Some Road, Some Where
email:                
phone:                0400 98
phone2:               0400 988
checkbox:             checkbox
conname2:             Alicia
select:               Female
phone22:              6
textarea:             Test 1223
Submit2:              Submit
You'll need to learn a little about PHP in order to edit the script to pretty it up:

My first suggestion would be to use better fieldnames...
Nice pull, klykken...