Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10

Thread: Html form

  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Html form

    I have an HTML form that has validations on some fields as well as other fields that dont have it. The past couple of days I have been getting blank emails of every form at least once a day. I have a few forms in my website, including ones in different languages, and this morning i got an email from each form with blank answers. I have a captcha on each one of the forms too. HELP

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,865
    Thanks
    6
    Thanked 1,029 Times in 1,002 Posts
    Would you go to the police to report that your car was stolen without telling them what kind of car, how it looked, and where it was stolen? No? So why do you think you get help here without giving any useful information?

  • #3
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hi

    sorry, no need to be rude. I wasnt sure what you guys would need. Cause its an html form that is run with php.
    Code:
    <form name="form1" action="captcha.php","http://www.mark-10.com/cgi-bin/mailto" method="post" onsubmit="return ErrorCheck();">
    <INPUT TYPE="hidden" NAME="RECIPIENT" VALUE="info@mark-10.com">
    <INPUT TYPE="hidden" NAME="subject" VALUE="Mark-10 Web Submit Form">
    <INPUT TYPE="hidden" NAME="THANKURL" VALUE="http://www.mark-10.com/thankyou-inquiry.html"> 
    <input type="hidden" name="identicalfields" value="email,email2">
     
        <table width="661" height="254" border="0" align="center" cellpadding="3" cellspacing="0">
          <tr valign="middle" class="style1">
            <td><div align="right"><font color="#000000"><span class="largeBlackBody"><span class="LargeBold12Cs-b">*Name:</span></span></font></div></td>
            <td><input name="name" type="text" id="name" size="20">
              &nbsp;&nbsp;</td>
          </tr>
          <tr class="boduHelv12">
            <td><div align="right">Title:</div></td>
            <td><span class="LargeBold12Cs-b">
              <input name="surname" type="text" id="surname" size="20">
            </span></td>
          </tr>
          <tr class="style1">
            <td valign="middle"><div align="right" class="LargeBold12Cs-b"><font color="#000000" class="largeBlackBody">*Email:</font></div></td>
            <td><input name="email" type="text" id="email" size="38"></td>
          </tr>
          <tr class="style1">
            <td valign="middle"><div align="right" class="LargeBold12Cs-b"><font color="#000000" class="largeBlackBody">*Confirm Email:</font></div></td>
            <td><input name="email2" type="text" id="email2" size="38"></td>
          </tr>
          <tr class="style1">
            <td width="108" valign="middle"><div align="right"><font color="#000000" class="LargeBold12Cs-b">Company:</font></div></td>
            <td width="541"><input name="Company" type="text" id="Company" size="45">
    &nbsp;<br></td>
          </tr>
          <tr valign="middle" class="style1">
            <td width="108"><div align="right" class="LargeBold12Cs-b"><font color="#000000" class="largeBlackBody">*Address:</font></div></td>
            <td width="541"><input name="address" type="text" id="address" size="40">
              </td>
          </tr>
          <tr valign="middle" class="style1">
            <td width="108"><div align="right" class="LargeBold12Cs-b">*City:</div></td>
            <td width="541"><input name="city" type="text" id="city" size="20">
            <font color="#000000" class="largeBlackBody">&nbsp;</font></td>
          </tr>
          <tr valign="middle" class="style1">
            <td><div align="right" class="LargeBold12Cs-b">*State:</div></td>
            <td><input name="region" type="text" id="region" size="10"></td>
          </tr>
          <tr valign="middle" class="style1">
            <td><div align="right" class="LargeBold12Cs-b"><font color="#000000" class="largeBlackBody">*ZIP/Postal Code:</font></div></td>
            <td><input name="zip" type="text" id="zip" size="8"></td>
          </tr>
          <tr valign="middle" class="style1">
            <td><div align="right" class="LargeBold12Cs-b"><font color="#000000" class="largeBlackBody">*Country:</font></div></td>
            <td><input name="country" type="text" id="country" size="8"></td>
          </tr>
          <tr valign="middle" class="style1">
            <td width="108"><div align="right"><font color="#000000" class="LargeBold12Cs-b">Telephone:</font></div></td>
            <td width="541"><input name="telephone" type="text" id="telephone" size="25">
      &nbsp;&nbsp;<font color="#000000" class="LargeBold12Cs-b">Ext:</font>
      <input name="extension" type="text" id="extension" size="25"></td>
          </tr>
          <tr valign="middle" class="style1">
            <td><div align="right"><font color="#000000" class="LargeBold12Cs-b">Fax:</font></div></td>
            <td><input name="fax" type="text" id="mobile" size="25"></td>
          </tr>
          <tr valign="middle" class="style1">
            <td><div align="right"><font color="#000000" class="LargeBold12Cs-b"> Application or Question:</font></div></td>
            <td><p><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>
                <textarea name="comments" cols="60" rows="5" wrap="PHYSICAL" id="comments"></textarea>
              </b></font></p>
                
               
             </td>
          </tr>
          <tr bordercolor="#111111">
            <td colspan="2" height="6"><input type="checkbox" name="SendCatalog" value="Yes">
              <font size="2"> Send me 
                your latest catalog</font></td>
          </tr>
          <tr bordercolor="#111111">
            <td colspan="2" height="34"><input type="checkbox" name="AddToMailingList" value="Yes">
              <font size="2"> Add me to 
                your mailing list</font></td>
          </tr>
          <tr valign="middle" class="style1">
            <td>&nbsp;</td>
            <td align="left" valign="top">*Please Enter Code-&gt;<img src="captcha_image.php" alt="" />: </div>
              <input name="Security_Code" type="text" id="Security_Code" size="15"></td>
          </tr>
        </table>
        <table width="663" class="bigone">
          <tr class="style1">
            <td width="109" height="38" align="center"><p>
            <td width="542" align="left"><input name="Submit" type="submit" id="scratch_submit" onClick="MM_validateForm('email','','RisEmail','email2','','RisEmail','address','','R','city','','R','region','','R','zip','','R','country','','R','Security_Code','','R');return document.MM_returnValue" value="Submit">
              <input type="reset" name="Reset" value="Reset">
              *Required Fields       
          </tr>
          </table>
     
      </form></td>
    </tr>
    </table>
    <br>
     
    
     
     
     
    <table cellspacing="2" width=525 border=0 celpadding="3">
     
     
     
    </table>
    </FORM>

  • #4
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    php code

    PHP Code:
    <?


    session_start
    ();


    if (
    $_POST['Security_Code'] == $_SESSION["pass"])
    {
        
    header("Location: http://www.mark-10.com/thankyou-inquiry.html");
                   
           
    //sends email via php to the following address
    $mailuser "info@mark-10.com";

    //echo 'default chosen address: '.$mailuser;
            
        
    $header "Return-Path: ".$mailuser."\r\n"
        
    $header .= "From: Inquiry<".$mailuser.">\r\n"
        
    $header .= "Content-Type: text/html;"

    $mail_body 
    'The User: '.$_POST[name].' has sent his input.
        Name: '
    $_POST[name] . '<br>
        Title: '
    $_POST[surname] . '<br>
        email: '
    $_POST[email] . '<br>
        confirm email: '
    $_POST[email2] . '<br>
        Company: '
    $_POST[company] . '<br>
        Address: '
    $_POST[address] . '<br>
        Address: '
    $_POST[address2] . '<br>
        City: '
    $_POST[city] . '<br>
        State: '
    $_POST[region] . '<br>
        Zip: '
    $_POST[zip] . '<br>
        Country: '
    $_POST[country] . '<br>
        Telephone: '
    $_POST[tel] . '<br>
        Extention: '
    $_POST[ext] . '<br>
        fax: '
    $_POST[fax] . '<br>
        Application or Question:' 
    $_POST[comments] .'<br>
        Catalog:' 
    $_POST[SendCatalog] .'<br>
        Mailing List:' 
    $_POST[AddToMailingList] .'<br>'
    ;
        
    mail ($mailuser'Mark-10 Web Inquiry'$mail_body$header);
             echo 
    'THANKS ';   
           

    } else {
          
    header"Location:http://www.mark-10.com/tryagain.html" ) ;
          exit;
    }
    ?>

  • #5
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    There's no data validation in the form handler (assuming the PHP you posted is captcha.php, that's your form handler). Unless that javascript function ErrorCheck() that the form uses onsubmit contains it, it's entirely possible to get empty values or anything else. Since you didn't post that function, it's impossible to know what it does.
    Are you a Help Vampire?

  • #6
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Make a start by printing out your POST variables; that way we can see whether, as Tom said, the variables ever reach the script.

  • #7
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes it is. Its on the submit button, when they hit the submit button and the fields aren't filled out a window pops up that they need to fill in those fields. here is the error check js its only for the email to make sure that there fields match.
    Code:
    function ErrorCheck() {
      var formname = "form1";
      var fieldwithlist = "identicalfields";
      var er = new String();
      var tempstring = eval("document."+formname+"."+fieldwithlist+".value");
    
      if(tempstring.length > 1) {
        var idi = tempstring.split(',');
        var ts0 = eval("document."+formname+"."+idi[0]+".value");
        var ts1 = eval("document."+formname+"."+idi[1]+".value");
        if(ts0 != ts1) { er = 'The e-mail addresses do not match. Please re-enter them again.'; }
      }
    
      if(er.length > 0) {
        alert(er);
        return false;
      }
    
      return true;
    }
    Last edited by designer525; 07-23-2010 at 07:04 PM.

  • #8
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Oh, I see. The required field checker is one of those crappy Dreamweaver functions. Got it. Assuming that actually works, your next step would be to follow Apostropartheid's advice and dump your post variables at the top of the form handler. I'd recommend doing the same for the session variables, too.
    Are you a Help Vampire?

  • #9
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what will dumping those variables on top do?

  • #10
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Quote Originally Posted by designer525 View Post
    what will dumping those variables on top do?
    This:
    Quote Originally Posted by Apostropartheid View Post
    Make a start by printing out your POST variables; that way we can see whether, as Tom said, the variables ever reach the script.
    Are you a Help Vampire?


  •  

    Posting Permissions

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