Jump to content

Form Mail HELP!


steviep19

Recommended Posts

Hi

Im fairly new to PHP and would like some help.

I have a form set out in HTML and need it to email an address on submit.

I need it to then redirect to a php page (thanks page)

 

Here is my form....can any one help me with the contactprocess.php file??

 

<form action="contactusprocess.php" method="post">

                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                  <tr>

                    <td class="formref">Referral Location</td>

                    <td><label>

                      <select name="Referral Location">

                        <option value="Chester">Chester</option>

                        <option value="Chester">Liverpool</option>

                          </select>

                    </label></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td class="formref">Referring Practitioner</td>

                    <td><input name="Referring Practitioner" type="text" size="50" /></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td class="formref">Patient’s Name</td>

                    <td><input name="Patient Name" type="text" size="50" /></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td valign="top" class="formref">Practice Address</td>

                    <td><textarea name="Practice Address" cols="38" rows="3"></textarea></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td class="formref">Practice Post Code</td>

                    <td><input name="Practice Post Code" type="text" size="50" /></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td class="formref">Practice Telephone No</td>

                    <td><input name="Practice Telephone No" type="text" size="50" /></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td class="formref">Patient’s Name</td>

                    <td><input name="Patients Name" type="text" size="50" /></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td class="formref">Patient’s Date of Birth</td>

                    <td><input name="Patient DOB" type="text" size="50" /></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td class="formref">Parent’s Full Name</td>

                    <td><input name="Parent Full Name" type="text" size="50" /></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td valign="top" class="formref">Home Address</td>

                    <td><label>

                      <textarea name="Home Address" cols="38" rows="3"></textarea>

                    </label></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td class="formref">Postal Code</td>

                    <td><label>

                      <input name="Postal Code" type="text" size="50" />

                    </label></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td class="formref">Patient’s Telephone No (H)</td>

                    <td><label>

                      <input name="Patient Tel (H)" type="text" size="50" />

                    </label></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td valign="top" class="formref">Patient’s Telephone No (W)</td>

                    <td><input name="Patient Tel (W)" type="text" size="50" /></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td valign="top" class="formref">Patient’s Email Address</td>

                    <td><textarea name="Patient Email" cols="38" rows="3"></textarea></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td class="formref">Nhs/Private</td>

                    <td><select name="select3">

                      <option value="NHS">NHS</option>

                      <option value="Private">Private</option>

                                        </select></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td> </td>

                  </tr>

                  <tr>

                    <td valign="top" class="formref">Patient’s Oral Condition</td>

                    <td><textarea name="Patient Oral Condition" cols="38" rows="3"></textarea></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td align="right"> </td>

                  </tr>

                  <tr>

                    <td valign="top" class="formref">Reason of referral to orthodontist</td>

                    <td><textarea name="Reason of referral to orthodontist" cols="38" rows="3"></textarea></td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td align="right"> </td>

                  </tr>

                  <tr>

                    <td> </td>

                    <td align="right"><div id="submitpad"><label>

                      <input name="Submit" type="submit" class="submit" value=" " />

                    </label></div></td>

                  </tr>

                </table>

                            </form>

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/170693-form-mail-help/
Share on other sites

First of all, please use the BBcode "CODE" tags. its the "#" symbol on the editor.

 

Second, do some research, I'll help you out this time: http://www.w3schools.com/PHP/php_mail.asp

 

Now for re-directing, after your email is sent in the script you build, just add a

 

header("Location: address");

Link to comment
https://forums.phpfreaks.com/topic/170693-form-mail-help/#findComment-900267
Share on other sites

I gave you a resource that tells you exactly how to do what you are trying to do.

But I personally don't believe in handing someone a fully done script when they didn't have anything to start with.

 

Start writing it up, and if you run into problems post in this thread and either myself or others will help you out.

 

Just please realize I don't intend to be cruel or seem like a jerk, I'm just trying to get you interested and learning rather then handing you a spoon full of code.

 

You have to try before you can fail.

Link to comment
https://forums.phpfreaks.com/topic/170693-form-mail-help/#findComment-900475
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.