Results 1 to 8 of 8
  1. #1

    Submit Form Problem

    I'm trying to get a form to send me a users name and email for my newsletter. The problem I'm having is when I click the submit button it opens up my mail client instead of sending the info to my email. Can some one tell me what I'm doing wrong?
    <form action="mailto:[email protected] Newsletter " method="post" enctype="text/plain">
    Name: <INPUT NAME="Name" TYPE="text" VALUE="Name" SIZE=20><BR>
    Email: <INPUT NAME="Email" TYPE="text" VALUE="Email" SIZE=20><BR>
    <tr><td align=center>
    <INPUT TYPE="submit" value="Submit" style="color: #ffffff; background-color: #000000">
    Thanks for any help you can give.
    My Sites: Fireson | Jadice426

  2. #2
    Join Date
    Jun 2002
    You ar going to need to use some form of form processor script. Take a look at hotscripts.

  3. #3
    Yup...your form is doing exactly what you have told it to do...send it to the mailto address

  4. #4
    Join Date
    Oct 2003

    Another option is to use the 'formmail' system available via your control panel.
    If you require any assistance with it I'll be hiding on IRC!
    Web hosting by Fused For businesses with more important things to do than worry about their hosting.

  5. #5
    Join Date
    Sep 2006
    England, London
    can you use asp ??
    Giving up does not always means you are weak, it Simply means you are strong to let go!

  6. #6
    Join Date
    Jun 2006
    Cheshire, UK
    Insert this code providing you can run PHP, at the top of your PHP page in PHP tags. You will need to run your own validation, this is a very simple contact form and works well

    PHP Code:

    // Contact US Form PHP Code
    // Carl Pickering - Line3 Internet Ltd

    // Stops page from sending form when loaded
    if($_POST['action']=='send') {

    // define some variables first
    $send_to "[email protected]";
    $subject "Subject";

    // Pop-Up Txt
    $thank_you ="Thank you for enquiry, we will contact you back soon";

    $c_person $_POST['c_name'];
    $c_email $_POST['c_email'];
    $c_phone $_POST['c_phone'];
    $c_message $_POST['c_message'];

    // Build the message
    $message "The following person has sent information from the website\n\n";
    $message .= "Name: $c_person\n";
    $message .= "Telephone: $c_phone\n";
    $message .= "Email: $c_email\n";
    $message .= "Message: $c_message \n";
    $mailheaders "From: $c_person <$c_email> \n";
    $mailheaders .= "Reply-To: $c_person <$c_email>\n\n";

    // Simple but basic.. Now send the email

    " <script language=\"Javascript\"> alert('$thank_you'); </script> ");

    Form Code:

    HTML Code:
    <form action="contact.php" method="post" enctype="multipart/form-data" name="contact_us" id="form">
      <table cellpadding="0" cellspacing="0" border="0" width="100%">
            <td height="23" style="padding:2px 0px 0px 0px;" align="right" width="100%">Your Name:</td>
            <td><input name="c_name" type="text" class="input_2" id="c_name"></td>
            <td height="23" style="padding:2px 0px 0px 0px;" align="right" width="100%">Your Phone:</td>
            <td><input name="c_phone" type="text" class="input_2" id="c_phone"></td>
          <td height="23" style="padding:2px 0px 0px 0px;" align="right">Your email: </td>
          <td><input name="c_email" type="text" class="input_2" id="c_email"></td>
            <td height="23" style="padding:2px 0px 0px 0px;" align="right" width="100%">Message:</td>
            <td><textarea name="c_message" cols="3" rows="3" id="c_message"></textarea></td>
            <td width="100%"><img src="images/spacer.gif" width="1" height="1" alt=""><input name="action" type="hidden" id="action" value="send"></td>
            <td align="right" style="padding:5px 0px 0px 0px;"><img src="images/read_1.gif" alt="" style="margin:0px 5px 0px 0px;"><a href="javascript:document.contact_us.reset();">Reset</a><img src="images/read_1.gif" alt="" style="margin:0px 5px 0px 30px;"><a href="javascript:document.contact_us.submit();">Submit</a></td>
    Notice the hidden form element, the form will only be posted, if that variable is sent.

    You may wanna use strip_tags on your code too, before posting, stops people injecting nasty code.... I do

    HTH - Like i said, its dead basic, but gets you going
    Carl Pickering, Line3 Internet
    UK VPS Provider; 99.98% uptime

  7. #7
    Thanks for the reply's. Sorry for the late reply but I was busy with the holidays. Thanks for the info David and I will look into that. And thanks for the code cpickering.
    My Sites: Fireson | Jadice426

  8. #8
    It looks a great code.

    Is it possible to integrate validation code in the form?

    I'm looking for that long time.

    Thank you,

Posting Permissions

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