I'm trying to write 'Send Comment' section to one of my pages. I can get a pop up window with a form in, and I know you can send the data by saying 'form action="MAILTO:someone@example.com" '.
That's very clumsy, since it opens up the email client.
I am aware of the GET and POST methods, but am a little baffled as to how to use them and how to process the information. I am quite happy to enter the comments onto the webpage manually when I get them.
That's very clumsy, since it opens up the email client.
That's correct. The mailto attribute does not send anything on its own. You can not submit the form with HTML alone. You are going to need to use a server side scripting language like PHP, .NET, Coldfusion, Ruby, etc. to actually send the information in the form.
The exact syntax will vary depending on your language of choice, but it will involve extracting the information via the name attribute of the form elements (other ways exist as well), and processing them some way. If you're going to use a database, be sure to protect your site from SQL injection when doing this.
Javascript is still client-side. You need a server side language like ones I named to submit the form.
PS - Thanks for the tip about Sarksap. I've been working on a full HTML5 redesign of the site in the past weeks. It will be released in the next few days.
Look into NateMail I use it to handle all my form handling and its free. Its written in PHP and will be sent to your email directly. It also protects against spam among other things. I can send you the code if you need it as I think he stopped working on it but I still have the files on my server processing my forms and my clients forms.
----------------------------------------------------------------------------------------------
WYSIWYG editors will never beat my hand written code!!!! Learn to do it in notepad and learn how to actually control your website! Current Project http://www.jmcanineservices.com
If I put a 'Make a comment' link at the end of each blog entry, how would I know which entry the reply comes from? I can imagine the blog page passing on a reference to the page with the form on, and that page passing on the reference to the email form, but working out how to do it is another matter.
Honestly I couldnt tell ya. I just use it to process simple forms. I dont try and modify anything or use it for blogs or anything like that. Yo can try asking in the PHP section or mailing thre creator directly about the question you have.
----------------------------------------------------------------------------------------------
WYSIWYG editors will never beat my hand written code!!!! Learn to do it in notepad and learn how to actually control your website! Current Project http://www.jmcanineservices.com
I think ASP could be very useful in order to manage forms in elegant ways. You have to link the form to an ASP page, which will send you all the information you need (sender name, messages and anything requested in the html form), and then redirects to the site.
Bookmarks