Mail form problems

Discussion in 'HTML & Website Design' started by Invertabid, Jan 27, 2007.

  1. #1
    Hi,

    I have been having a number of issues when trying to create a mail form.

    Basically i have created a rather simple html sheet ... it is a quiz in fact. The point is i want people to fill it in and submit the form to a designated mail address.

    But how?

    I just have no idea how to have the sheet submitted to the e-mail addy.... any help?

    Regards.

    Lee
     
    Invertabid, Jan 27, 2007 IP
  2. DatR

    DatR Peon

    Messages:
    210
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    DatR, Jan 27, 2007 IP
    DEVIL likes this.
  3. TechnoGeek

    TechnoGeek Peon

    Messages:
    258
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hello, Invertabid.
    You have to use a form-to-email script if your page is coded in HTML. This is a script in Perl or other scripting language that is loaded in the cgi-bin of your site. The form's action parameter is set to point to that script. There are many of these scripts in the net.
    Alternatively, you can learn to code in PHP and do everything in the page.
    Cheers.
     
    TechnoGeek, Jan 27, 2007 IP
  4. malayguy

    malayguy Peon

    Messages:
    152
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I have php form builder. PM me your email and I will send to you. ok?
     
    malayguy, Jan 28, 2007 IP
  5. Invertabid

    Invertabid Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I tried using a form mailer which i loaded into the cgi-bin but it reluctantly would not work....

    I am not overly useful with php but i will give it ago.

    Cheers for the help.

    Lee
     
    Invertabid, Jan 28, 2007 IP
  6. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #6
    You don't need a cgi script in case of html forms...
    You can just point the script to any php, asp etc script as well...

    <form action="scriptname.php" method="post">

    Use $_POST to get values of submission.

    $tvariable_one = $_POST['textfield1'];
    $tvariable_two = $_POST['textfield2'];

    similar for others...
    Check it for validity.
    if(condition)
    {
    //error or OK
    }
    Check each variable with good care...

    Then build your message using a (.) sign

    $message= "Text1= " . $tvariable_one . "\n Text2= " . $tvariable_two . "\n";
    $subject= "quiz submission";
    $to = "someone@domain.com";
    mail($to,$subject,$message);

    Checking for validity is an important part, specially when using mail function.
    Bye :)
     
    JEET, Jan 28, 2007 IP