October 29, 200916 yr Ive got a slight query im sure somebody could easily clear up for me if that's ok. I know how the typical contact form works, the three files include the html page, the process.php file and usually a thank you page. I know how to make a simple contact form which would include a name, email, telephone and message box, but how would I go about editing the 'process' file if I were to alter the form code to add drop down boxes and other radio button items? At present here's my functioning code for a simple contact form. If I were to add extra fields to my form would I simply add a new line to the red code below like so or am I going wrong somewhere? <? $message .= " Planners submitted Interest ------------------------------ Name: " . $_POST['name']. " Company: " . $_POST['company']. " Email Address: " . $_POST['emailaddress']. " Telephone Number: " . $_POST['telephonenumber']. " Message: " . $_POST['message']. " NEW LINE GOES HERE??? "; $to = "chris-dicko@live.co.uk" ; $subject = 'Planners submitted Interest'; $mailHeaders = "From: No Reply "; $mailHeaders .= "<chris-dicko@live.co.uk>\r\n"; mail($to, $subject, $message, $mailHeaders); header ("Location: thankyou.php"); exit; ?> I generally want to add some new fields to my form such as a couple of check boxes and drop down selection boxes. Does it matter what the form field type is as long as it is called from in the function file?
October 29, 200916 yr simple enough.... here is the code for the form html page for say a drop down for how tey found your site <label>How did you find us?</label> <SELECT NAME="find" SIZE="1"> <OPTION SELECTED>n/a. <OPTION>Recommendation <OPTION>Leaflet <OPTION>Local Press <OPTION>Search Engine <OPTION>Other </SELECT> then in you process.php file you need the following $find = $_POST['find'] ; $message = "what ever you want etc... then to add the find drop down just add Found $find and it will show the answer"
Create an account or sign in to comment