steviep19 Posted August 17, 2009 Share Posted August 17, 2009 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 Quote Link to comment Share on other sites More sharing options...
deadlyp99 Posted August 17, 2009 Share Posted August 17, 2009 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"); Quote Link to comment Share on other sites More sharing options...
steviep19 Posted August 17, 2009 Author Share Posted August 17, 2009 Gee, thanks for your help - ie 'go look yourself' youd think i already hadnt done that?! Quote Link to comment Share on other sites More sharing options...
deadlyp99 Posted August 17, 2009 Share Posted August 17, 2009 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.