dinesh101 Posted September 14, 2012 Share Posted September 14, 2012 I want to include a form in my website for visitors to enter there name, email and message. I have yet not learnt how to do it so i am looking for help...If sending form data to an email is too complicated, I dont mind having a system in which the form data is written on to a file in my server directory. Eg: a note which i can read manully. Link to comment Share on other sites More sharing options...
niche Posted September 14, 2012 Share Posted September 14, 2012 (edited) This will get you started http://www.w3schools...hp/php_mail.asp It's pretty easy, but let us know if you need help. Please notice that the link is for a php function. I suggest the php/sql route before trying to add javascript top the mix. Edited September 14, 2012 by niche Link to comment Share on other sites More sharing options...
Labtec Posted September 17, 2012 Share Posted September 17, 2012 Your form needs an action attribute of a specified file which will deal with the submitted data. <form action="some_file.php" method="POST"> <fieldset> <legend>Comment Form</legend> <p><label for="name">Name:</label><input type="text" id="name" name="name" /></p> <p><label for="email">Email:</label><input type="text" id="email" name="email" /></p> <p><label for="comment">Comment:</label><textarea name="comment" rows="5" cols="30"></textarea></p> <p><input type="submit" name="submit" value="Send Comment" /><input type="reset" name="reset" value="Clear" /></p> </fieldset></form> PHP script: $name = $_POST['name'];$email = $_POST['email'];$comment = $_POST['comment']; etc. There is more validation to be done before sending the email. Give niche's link a read. Regards, Labtec. Link to comment Share on other sites More sharing options...
dinesh101 Posted September 20, 2012 Author Share Posted September 20, 2012 Thanks alot mates....I will give it a try and get back 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