tires Posted April 8, 2016 Share Posted April 8, 2016 Hi! I found several modules and older descriptions in this forum to set up contactforms. But which is the easiest way to get a small, nice contact form? What is your recommendation? Thanks a lot! Link to comment Share on other sites More sharing options...
kongondo Posted April 8, 2016 Share Posted April 8, 2016 It's difficult to give a recommendation because: We don't know what your needs (for the form) are We don't know exactly what other 'modules and descriptions' you've looked at already. We might just refer you back to one of them We don't know what you mean by easiest We don't know what is a small, nice contact form (nice: are you talking about CSS here? small: number of fields?) We don't know how you wish to capture and store the form information (in a field, in some page?) OK, maybe it's just me who doesn't know these things . Your question is a bit vague. If possible tell us what exactly what you've already considered and what your needs are. Having said all that, any HTML form can be used as a ProcessWire form. You just need that and some template file and you are done 3 Link to comment Share on other sites More sharing options...
teppo Posted April 8, 2016 Share Posted April 8, 2016 While I agree with what Kongondo has posted above, easiest method for just about any form-related need is usually FormBuilder. FormBuilder is a commercial module, and if that's a problem (and you really just need a very simple contact form) I'd suggest taking a look at Simple Contact Form by Bea. 3 Link to comment Share on other sites More sharing options...
pwired Posted April 8, 2016 Share Posted April 8, 2016 Setting up a contact form is an ever returning question so here you go: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/https://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/https://processwire.com/talk/topic/407-processing-contact-forms/?hl=+create%20+simple%20+contact%20+form 1 Link to comment Share on other sites More sharing options...
anttila Posted April 8, 2016 Share Posted April 8, 2016 The real question is, why you want to do this with module? Creating a simple contact form is easy. <?php$action=$_REQUEST['action']; if ($action=="") /* display the contact form */ { ?> <form action="" method="POST" enctype="multipart/form-data"> <input type="hidden" name="action" value="submit"> Your name:<br> <input name="name" type="text" value="" size="30"/><br> Your email:<br> <input name="email" type="text" value="" size="30"/><br> Your message:<br> <textarea name="message" rows="7" cols="30"></textarea><br> <input type="submit" value="Send email"/> </form> <?php } else /* send the submitted data */ { $name=$_REQUEST['name']; $email=$_REQUEST['email']; $message=$_REQUEST['message']; if (($name=="")||($email=="")||($message=="")) { echo "All fields are required, please fill <a href=\"\">the form</a> again."; } else{ $from="From: $name<$email>\r\nReturn-path: $email"; $subject="Message sent using your contact form"; mail("info@tewdin.com", $subject, $message, $from); echo "Email sent!"; } } ?> 1 Link to comment Share on other sites More sharing options...
netcarver Posted April 9, 2016 Share Posted April 9, 2016 @tewdin,Easy, yes - but not that easy. Please add input sanitisation and return value checks to your code posted above. I think you should also be getting the values from Post input, not from request input. If you have live code like the example you posted, you should probably revise it. 8 Link to comment Share on other sites More sharing options...
giannisok Posted September 6, 2016 Share Posted September 6, 2016 Check my post here: Link to comment Share on other sites More sharing options...
giannisok Posted September 6, 2016 Share Posted September 6, 2016 Check my post here: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now