Jump to content

php sending blank form?


determined

Recommended Posts

Every now and then (more frequently lately), I get a blank email from the form I built in php. I am guessing it is from the php but not entirely sure. This is the top of the email that I get:

 

"From: maximo@From: [email protected]

[mailto:[email protected]]

Sent: Tuesday, March 18, 2008 1:25 PM

[mailto:[email protected]]

Sent: Tuesday, March 18, 2008 1:25 PM"

 

So I don't really know what all of that means or why it is sending me a blank form. I know it isn't just some spammer because I have the form set up where people cannot move forward unless they fill in the form fields.

 

I appreciate your help identifying the issue here.

 

 

Link to comment
https://forums.phpfreaks.com/topic/96805-php-sending-blank-form/
Share on other sites

I have javascript on that first page.

 

function validate_form ( )
{
    valid = true;

    if ( document.rmavalidation.firstname.value == "" )
    {
        alert ( "First Name is required" );
        valid = false;
    }
 if ( document.rmavalidation.lastname.value == "" )
    {
        alert ( "Last Name is required" );
        valid = false;
    }
 if ( document.rmavalidation.email.value == "" )
    {
        alert ( "A valid Email Address is required" );
        valid = false;
    }
if ( document.rmavalidation.street1.value == "" )
    {
        alert ( "Address is required" );
        valid = false;
    }
if ( document.rmavalidation.city.value == "" )
    {
        alert ( "City is required" );
        valid = false;
    }
if ( document.rmavalidation.ZIP.value == "" )
    {
        alert ( "Zip Code is required" );
        valid = false;
    }
if ( document.rmavalidation.phone1.value == "" )
    {
        alert ( "Phone Number is required" );
        valid = false;
    }
if ( document.rmavalidation.store.value == "" )
    {
        alert ( "Store purchased from is required" );
        valid = false;
    }
if ( document.rmavalidation.orderDate1.value == "" )
    {
        alert ( "Order date is required" );
        valid = false;
    }
if ( document.rmavalidation.returnReason.value == "" )
    {
        alert ( "A return reason is required" );
        valid = false;
    }
    return valid;
}

My guess is that your form processing code unconditionally sends an email any time the URL of the form processing code is requested, such as when a search engine spiders the site.

 

You would need to post your code to get specific help with what it might be doing.

 

BTW: Spam bot scripts and search engine spiders visit your form processing code directly and don't directly care about your form (or any javascript that might be on it.)

Do you know a great resource to learn how to add php validation? I am slowly learning php as I need it.

 

Here is the code I am using on my validation page

 

<script type="text/JavaScript">
<!--
function validate_form ( )
{
    valid = true;

    if ( document.rmavalidation.firstname.value == "" )
    {
        alert ( "First Name is required" );
        valid = false;
    }
 if ( document.rmavalidation.lastname.value == "" )
    {
        alert ( "Last Name is required" );
        valid = false;
    }

if ( document.rmavalidation.street1.value == "" )
    {
        alert ( "Address is required" );
        valid = false;
    }
if ( document.rmavalidation.city.value == "" )
    {
        alert ( "City is required" );
        valid = false;
    }
if ( document.rmavalidation.ZIP.value == "" )
    {
        alert ( "Zip Code is required" );
        valid = false;
    }
if ( document.rmavalidation.phone1.value == "" )
    {
        alert ( "Phone Number is required" );
        valid = false;
    }
 if ( document.rmavalidation.email.value == "" )
    {
        alert ( "A valid Email Address is required" );
        valid = false;
    }
if ( document.rmavalidation.store.value == "" )
    {
        alert ( "Store purchased from is required" );
        valid = false;
    }
if ( document.rmavalidation.orderDate1.value == "" )
    {
        alert ( "Order date is required" );
        valid = false;
    }
if ( document.rmavalidation.returnReason.value == "" )
    {
        alert ( "A return reason is required" );
        valid = false;
    }
    return valid;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

}
//-->
</script>

</head>
<form name='rmavalidation' id='rmavalidation' action='rmaprocess.php' method='post' >
                    <tr>
                      <td class='inputverify'><font color="red">*</font> First Name:</td>
                      <td width="564" class='inputverify' ><input id="firstname" name='firstname' type='text' size='50' maxlength='50' value='<?PHP echo ($firstname) ?>' />
                    <?PHP if (!$firstname)
      echo "<font face=arial size=2 color=red>  First Name is Required.</font>";?>                    </tr>
                    <tr>
                      <td class='inputverify'><font color="red">*</font> Last Name:</td>
                      <td><input name='lastname' type='text' size='50' maxlength='50' value='<?PHP echo ($lastname)?>' />
                           <?PHP if (!$lastname)
      echo "<font face=arial size=2 color=red>  Last Name is Required.</font>";?>                   </td>
                    </tr>
                    <tr>
                      <td class='inputverify'> Organization:</td>
                      <td><input name='organization' type='text' size='50' maxlength='50' value='<?PHP echo($organization)?>' />                      </td>
                    </tr>
                    
                          <input name="Submit" type="Submit" alt="Submit your info" value="Send Your Information"/>
                      </div></td>
                    </tr>
                  </form>
              </table></td>
      </tr>

</body>
</html>

 

Thank you for your help!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.