www.webdeveloper.com
Results 1 to 11 of 11

Thread: Sending information from a FORM

  1. #1
    Join Date
    Aug 2004
    Posts
    35

    Sending information from a FORM

    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.

    I would be very grateful for any assistance.

  2. #2
    Join Date
    Nov 2010
    Location
    Los Angeles, CA
    Posts
    234
    Quote Originally Posted by cnh View Post
    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.

    If you choose to use PHP, here is some code to get you started: http://www.w3schools.com/php/php_forms.asp

  3. #3
    Join Date
    Aug 2004
    Posts
    35
    Yes indeed. Have you any suggestions for a suitable javascript?

    (PS sarksap overflows its divs in Firefox with my current settings)

  4. #4
    Join Date
    Nov 2010
    Location
    Los Angeles, CA
    Posts
    234
    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.

  5. #5
    Join Date
    Aug 2004
    Posts
    35
    Thanks. I read thru the PHP methods, and although I got the general idea, I think implementing it might be another matter!"

  6. #6
    Join Date
    Feb 2011
    Location
    Chuluota, Florida
    Posts
    144
    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

  7. #7
    Join Date
    Aug 2004
    Posts
    35
    Thank you for the link to NateMail - it looks to be exactly what I want.

    I downloaded the HTML version and I'll try playing around with it.

    Many thanks.

  8. #8
    Join Date
    Aug 2004
    Posts
    35
    Works a treat.

    Tiny snagette.

    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.

  9. #9
    Join Date
    Feb 2011
    Location
    Chuluota, Florida
    Posts
    144
    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

  10. #10
    Join Date
    Aug 2004
    Posts
    35
    Okay. Many thanks, anyway.

  11. #11
    Join Date
    Mar 2011
    Location
    Rome, Italy
    Posts
    98

    ASP solution

    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.

    You'll find useful informations here:
    http://www.w3schools.com/asp/asp_send_email.asp

    And if you want, take also a look at my works...
    http://www.easycure.it/
    http://www.retrofun.it/main.asp?lang=en&pos=welcome

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles