HTML Form - PHP Email with custom messages and tickbox -
i have html form radio buttons, option boxes (drop down boxes), checkboxes, text fields , on. have form pointed file called send.php email form on how tickboxes , radio buttons , input text in between each answer? kind of format this:
welcome: {name} age group between: {radio button age groups}
and on. can't give actual code private can give instead uses kind of code , format:
<form action="send.php"> <input type="radio" name="agegroup" value="agegroup1"> 0-18<br> <input type="radio" name="agegroup" value="agegroup2"> 19-29<br> <input type="radio" name="period" value="agegroup3"> 30-39<br> <input type="radio" name="period" value="agegroup4"> 40-49<br> <input type="radio" name="period" value="agegroup5"> 50+<br> <br><br><br><br> <select name="country"> <option value ="uk">united kingdom</option> <option value ="usa">united states</option> </option></select> <br><br><br><br> <input type="text" name="postcode" size="5"> <br><br><br><br> <input type="text" name="housenumber" size="5"> <br><br><br><br> <textarea id="family" class="input" name="familynumber" rows="10" cols="60"></textarea> <br><br><br><br> <input type="checkbox" name="delievery" value="nextday"> next day delievery <br> <input type="checkbox" name="delievery" value="twotofive"> 2-5 day <br> <input type="checkbox" name="outcome" value="dismissed"> dismissed <br><br><br><br><br><br> <center><button id="send" type="submit" style="height:25px; width:100px; background-color: grey">send</button></center> </form>
sorry it's random. ran out of ideas! sorry coding abilities, don't html!
thanks.
i'm hoping help...if i'm understanding question correctly.
make sure add method form tag. example: <form action="send.php" method="post">
. in send.php, want grab variables name attribute, example:
$name = $_post['name']; $agegroup = $_post['agegroup'];
and want build out email. php allows variables parsed in double quote strings, can build message way want it. (reference)
$to = "person@example.com"; $subject = "subject goes here"; $message = "welcome: $name. age group between: $agegroup"; //note: headers optional $headers = "from: you@example.com" . "\r\n" . "cc: anotherperson@example.com"; mail($to, $subject, $message, $headers);
this simple example, might able started.
Comments
Post a Comment