Forms making it work.

Discussion in 'Web Design and Development' started by heehee, Feb 25, 2009.

  1. heehee macrumors 68020

    heehee

    Joined:
    Jul 31, 2006
    Location:
    Same country as Santa Claus
    #1
    I'm trying to setup a form in my website, but I don't know how to make it work. I know how to code the actual form, but how do I make it send it to my email? Is there a easy code to do this? :eek:
     
  2. Trajectory macrumors 6502a

    Joined:
    Nov 13, 2005
    Location:
    Earth
    #2
    The part of the Form tag you are interested in is the "action" parameter. This tells the browser what page/script will process the form when you click on the Submit button.

    You can try adding action="mailto:me@email.com" to the form tag, but, not all browsers support this. If it does, you will get an attachment by email with the form data in one long string. It's not pretty, but, it's easy.

    The only way to make this work for all browsers is to use a web script (PHP, Cold Fusion, Javascript, CGI) to collect the form data and send it by email.
     
  3. heehee thread starter macrumors 68020

    heehee

    Joined:
    Jul 31, 2006
    Location:
    Same country as Santa Claus
  4. Trajectory macrumors 6502a

    Joined:
    Nov 13, 2005
    Location:
    Earth
    #4
    Then you'll need to use a server-side script to process the form data.
     
  5. brisbaneguy29 macrumors 6502

    brisbaneguy29

    Joined:
    Nov 27, 2007
    Location:
    Brisbane
    #5
    Hi, If your server has PHP, all you need is a PHP, mail processor. In I have attached a simple one to use here. In the form action, just insert the name of the attached file, and upload the attached file to your server.
    action="YouGetEmail.php"

    It will gather all your fields inside your form automatically, and email them to the address your specify. It even has the option to upload files to your server, and email them to you as attachments. Very simple.

    Give me an email if you have trouble setting it up.
     

    Attached Files:

  6. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #6
    Hey, brisbaneguy29, like that script, but how difficult would it be to modify it to send a .csv file instead of an HTML Table? I'll probably give it a try tonight if I get a chance, but any tips or warnings would be great.

    jW
     
  7. heehee thread starter macrumors 68020

    heehee

    Joined:
    Jul 31, 2006
    Location:
    Same country as Santa Claus
    #7
    Thanks brisbaneguy29. How do i setup my email in the YouGetEmail.php? I think I changed the email in the code, but it's not working. :eek:
     
  8. brisbaneguy29 macrumors 6502

    brisbaneguy29

    Joined:
    Nov 27, 2007
    Location:
    Brisbane
    #8
    Hey guys, sorry I was away for a couple of days, missed your posts. Do you still need a hand setting it up?
     

Share This Page