HTML form submit automated email using PHP -



HTML form submit automated email using PHP -

i have created html form, without difficulty (i relatively new html , css comfortable them). problem want submit button send info inputted in form user email address.

my php knowledge almost non-existent, , totally stuck. if has patience help, appreciated.

here code form...

<!doctype html> <html> <head> <meta charset="utf-8"> <title>life academy | pre-course questionnaire</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="pcq.css"> <link href='http://fonts.googleapis.com/css?family=open+sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div id="formbg"> <div id="formcontent"> <img src="pcqlogo.png" class="logo"> <p><strong>retirement planning course<br>anonymous pre-course questionnaire</strong><br>so course of study may more accurately reflect interests , possible concerns, finish , homecoming questionnaire before start of course, email, to<br> <a href="mailto:info@life-academy.co.uk"><strong>info@life-academy.co.uk</strong>.</a></p> <form> age<br> <input type="text" name="age"><br> years present/last company<br> <input type="text" name="yearswithcompany"><br> leaving date<br> <input type="text" name="leavingdate"><br> job role<br> <input type="text" name="role"><br> have company or occupational pension plan?<br> <input id="yes" type="radio" name="companypension" value="yes"> <label for="yes">yes</label> <input id="no" type="radio" name="companypension" value="no"> <label for="no">no</label><br> have personal &#40private&#41 pension plan?<br> <input id="yes" type="radio" name="personalpension" value="yes"> <label for="yes">yes</label> <input id="no" type="radio" name="personalpension" value="no"> <label for="no">no</label><br> gain course? please describe in detail.<br> <textarea name="liketogain" class="largetextbox"></textarea><br> main activities outside of work?<br> <input type="text" name="activities"><br> how think these activities develop/change in near future?<br> <textarea name="activitiesdevelop" class="largetextbox"></textarea><br> have concerns future? if so, list them here:<br> <textarea name="futureconcerns" class="largetextbox"></textarea><br> want create changes health/lifestyle? if so, please describe changes.<br> <textarea name="healthlifestylechanges" class="largetextbox"></textarea><br> how emphasis of life alter in future respect work/voluntary activity?<br> <textarea name="work" class="largetextbox"></textarea><br> have dietary requirements?<br> <input type="text" name="diet"><br> have other special requirements?<br> <textarea name="special" class="largetextbox"></textarea><br> <input type="submit" value"submit"> </form> </div> </div> </body> </html>

make php submission page , set form post it:

<form action="file_name.php" method="post"> //form fields go here </form>

then you'll need php mail service class. recommend phpmailer. basic usage , download: https://github.com/phpmailer/phpmailer

a file this: php_mailer.php

<?php include 'mailer'; include 'library'; include 'files'; ....rest of mailer code goes here.... ?>

on php mail service page can access of set fields $_post['name of field goes here']. ex. $_post['name'] or $_post['age'].

note basic explanation , require steps form validation, using javascript, , require setup on part of how want email formatted, etc. best alternative seek , test until can work. there plenty of php documentation available if hard grasp.

php html forms email

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -