shaun_469 Posted July 26, 2013 Share Posted July 26, 2013 hi all!, im trying to set up a website for myself using a free template from os templates.. the contact form code is .. <div id="contact" class="clear" ><br=""> <h2>Contact Us</h2> <div class="fl_left"> <form method="post" action="#"&> <label for="fullname">Name:</label> <input type="text" name="fullname" id="fullname" value=""> <label for="validemail">Email:</label> <input type="text" name="validemail" id="validemail" value=""> <label for="message">Message:</label> <textarea name="message" id="message" cols="45" rows="10"></textarea> <button type="submit" value="submit"><span>Submit[/u]</button> </div> from what i gather the action needs to be a php file to email me the comments.. so i used a free one from formtoemail.com and i just get a server error message when i press submit, ive tried changing the label names to one which match the php file, but it just wont work for me, i changed the action from # to the name of the php file, but i just cant figure out what im doing wrong thanks in advance to any help or advice you can give me, completely new to websites etc so please dont be to harsh on me! cheers, shaun Quote Link to comment Share on other sites More sharing options...
OOP Posted July 26, 2013 Share Posted July 26, 2013 (edited) Hi there, The action attribute specifies where to send the form-data when a form is submitted so you need to replace the '#' with your target file. Now, I don't know what you are doing in your PHP file but the global array $_POST will have the value of all of your form inputs fields which can be used in order to process your contact form. For example, in order to get the value of the input field "fullname" you can do something like this $fullName = $_POST['fullname]; Not to forget to say that you must not trust any inputs and must clean all before using in your script Hope this is easy to understand Edited July 26, 2013 by OOP Quote Link to comment Share on other sites More sharing options...
cpd Posted July 26, 2013 Share Posted July 26, 2013 Without your PHP we can't assist - a full dump wont help either so narrow it down to 10-20 lines based on the error you receive. Quote Link to comment Share on other sites More sharing options...
fastsol Posted July 27, 2013 Share Posted July 27, 2013 I have a ready to go Ajax style contact form that i distribute http://amecms.com/article/Easy-to-use-contact-form-with-validation 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.