mardi 31 août 2021

Problem with Form Validation and question about syntax

I am NOT a PHP Devleoper at all. I worked with basic if-else statements in Joomla years back but that's it.

I have this a long form (set up by a past employee) that basically takes the field input and writes it to a pdf doc and emails it to our client. The issue I'm having is that despite filling out every field, the script redirects me to an error page that is generated by the script.

I'm looking through the if else statements to make sure all of the fields it checks are correct and it looks like it all matches up. The form basically has a ton of if else blocks that check every section of form fields.

I've been looking at other people's code and was wondering if maybe it's a formatting issue with the if statements syntax.

Are the number and usage of the parenthesis in this line correct?

if((!isset($_POST['ocname2'])) || (!isset($_POST['ocage2'])) || (!isset($_POST['ocr2'])))

Is there a better way to handle the checking of these forms without so many if else statements and still have it pass the data on to the pdf writing script?

Here is entire section of if else code.

    // check that a form was submitted
    if(isset($_POST) && is_array($_POST) && count($_POST)){
        // we will use this array to pass to the createFDF function
        $data=array();
        
        // This displays all the data that was submitted. You can
        // remove this without effecting how the FDF data is generated.
        //echo'<pre>POST '; print_r($_POST);echo '</pre>';

        if(isset($_POST['FirstName'])){
            // the name field was submitted
           $pat='`[^a-z0-9\s]+$`i';
           if(empty($_POST['FirstName']) || preg_match($pat,$_POST['FirstName'])){
                // no value was submitted or something other than a
                // number, letter or space was included
                $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
                curl_exec($ch);  
                die('Invalid input for First Name field.');
            }else{
                // if this passed our tests, this is safe
                $data['FirstName']=$_POST['FirstName'];
                
                $data['FirstName']=strtolower($data['FirstName']);
            }
        }
        
        if(isset($_POST['LastName'])){
            // the name field was submitted
           $pat='`[^a-z0-9\s]+$`i';
           if(empty($_POST['LastName']) || preg_match($pat,$_POST['LastName'])){
                // no value was submitted or something other than a
                // number, letter or space was included
                $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
                curl_exec($ch);  
                die('Invalid input for Last Name field.');
            }else{
                // if this passed our tests, this is safe
                $data['LastName']=$_POST['LastName'];
                
                $data['LastName']=strtolower($data['LastName']);
            }
        }
        
        
            
//            if((!isset($_POST['Address'])) || (!isset($_POST['City'])) || (!isset($_POST['State'])) || (!isset($_POST['Zip'])) || (!isset($_POST['Telephone'])) || (!isset($_POST['FromName'])) || (!isset($_POST['FromTelephone'])) || (!isset($_POST['FromAddress'])) || (!isset($_POST['FromCity'])) || (!isset($_POST['FromState'])) || (!isset($_POST['FromZip']))) {
                // Why this? What if someone is spoofing form submissions
                // to see how your script works? Only allow the script to
                // continue with expected data, don't be lazy and insecure ;)
//                die('You did not form fully.');
//            }
            
//                        if(($_POST['Address'] == '') || ($_POST['City'] == '') || ($_POST['State'] == '') || ($_POST['Zip'] == '') || ($_POST['Telephone'] == '') || ($_POST['FromName'] == '') || (['FromTelephone'] == '') || ($_POST['FromAddress'] == '') || ($_POST['FromCity'] == '') || ($_POST['FromState'] == '') || ($_POST['FromZip'] == '')) {
//                // Why this? What if someone is spoofing form submissions
//                // to see how your script works? Only allow the script to
//                // continue with expected data, don't be lazy and insecure ;)
//                die('You did not form fully.');
//            }
            
            // Check your data for ALL FIELDS that you expect, ignore ones you
            // don't care about. This is just an example to illustrate, so I
            // won't check anymore, but I will add them blindly (you don't want
            // to do this in a production environment).
            
    //if((!isset($_POST['app'])) || (!isset($_POST['MiddleName'])) || (!isset($_POST['birthdate'])) || (!isset($_POST['ss'])) || (!isset($_POST['drlic'])))
    if((!isset($_POST['app'])) || (!isset($_POST['MiddleName'])) || (!isset($_POST['birthdate'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);  
        die('You did not form fully.');        
    }
    else
    {
        $data['app']=$_POST['app'];
        $data['MiddleName']=$_POST['MiddleName'];
        $data['birthdate']=$_POST['birthdate'];
       //$data['ss']=$_POST['ss'];
        //$data['drlic']=$_POST['drlic'];
        
        $data['app']=strtolower($data['app']);
        $data['MiddleName']=strtolower($data['MiddleName']);
        $data['birthdate']=strtolower($data['birthdate']);
        //$data['ss']=strtolower($data['ss']);
        //$data['drlic']=strtolower($data['drlic']);
    }
        
        
    //if((!isset($_POST['pastname'])) || (!isset($_POST['hphone'])) || (!isset($_POST['cphone'])) || (!isset($_POST['ss'])) || (!isset($_POST['email'])))
    if((!isset($_POST['pastname'])) || (!isset($_POST['hphone'])) || (!isset($_POST['cphone'])) || (!isset($_POST['email'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);  
        die('You did not form fully.');        
    }
    else
    {
        $data['pastname']=$_POST['pastname'];
        $data['hphone']=$_POST['hphone'];
        $data['cphone']=$_POST['cphone'];
        $data['email']=$_POST['email'];
        
        $data['pastname']=strtolower($data['pastname']);
        $data['hphone']=strtolower($data['hphone']);
        $data['cphone']=strtolower($data['cphone']);
        $data['email']=strtolower($data['email']);  
    }
    
    if((!isset($_POST['ocname1'])) || (!isset($_POST['ocage1'])) || (!isset($_POST['ocr1'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['ocname1']=$_POST['ocname1'];
        $data['ocage1']=$_POST['ocage1'];
        $data['ocr1']=$_POST['ocr1'];
        
        $data['ocname1']=strtolower($data['ocname1']);
        $data['ocage1']=strtolower($data['ocage1']);
        $data['ocr1']=strtolower($data['ocr1']);
    }
    
    if((!isset($_POST['ocname2'])) || (!isset($_POST['ocage2'])) || (!isset($_POST['ocr2'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['ocname2']=$_POST['ocname2'];
        $data['ocage2']=$_POST['ocage2'];
        $data['ocr2']=$_POST['ocr2'];
        
        $data['ocname2']=strtolower($data['ocname2']);
        $data['ocage2']=strtolower($data['ocage2']);
        $data['ocr2']=strtolower($data['ocr2']);
    }
    
    
    if((!isset($_POST['ocname3'])) || (!isset($_POST['ocage3'])) || (!isset($_POST['ocr3'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['ocname3']=$_POST['ocname3'];
        $data['ocage3']=$_POST['ocage3'];
        $data['ocr3']=$_POST['ocr3'];
        
        $data['ocname3']=strtolower($data['ocname3']);
        $data['ocage3']=strtolower($data['ocage3']);
        $data['ocr3']=strtolower($data['ocr3']);
    }
    
    if((!isset($_POST['crstreet'])) || (!isset($_POST['crcity'])) || (!isset($_POST['crstate'])) || (!isset($_POST['cramountpaid'])) || (!isset($_POST['crownerphone'])) || (!isset($_POST['crleaving'])) || (!isset($_POST['crrentpaid'])) || (!isset($_POST['crnotice'])) || (!isset($_POST['crmove'])) || (!isset($_POST['crbilled'])) || (!isset($_POST['crdate'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['crstreet']=$_POST['crstreet'];
        $data['crcity']=$_POST['crcity'];
        $data['crstate']=$_POST['crstate'];
        $data['cramountpaid']=$_POST['cramountpaid'];
        $data['crownerphone']=$_POST['crownerphone'];
        $data['crleaving']=$_POST['crleaving'];
        $data['crrentpaid']=$_POST['crrentpaid'];
        $data['crnotice']=$_POST['crnotice'];
        $data['crmove']=$_POST['crmove'];
        $data['crbilled']=$_POST['crbilled'];
        $data['crdate']=$_POST['crdate'];
        
        $data['crstreet']=strtolower($data['crstreet']);
        $data['crcity']=strtolower($data['crcity']);
        $data['crstate']=strtolower($data['crstate']);
        $data['cramountpaid']=strtolower($data['cramountpaid']);
        $data['crownerphone']=strtolower($data['crownerphone']);
        $data['crleaving']=strtolower($data['crleaving']);
        $data['crrentpaid']=strtolower($data['crrentpaid']);
        $data['crnotice']=strtolower($data['crnotice']);
        $data['crmove']=strtolower($data['crmove']);
        $data['crbilled']=strtolower($data['crbilled']);
        $data['crdate']=strtolower($data['crdate']);
    }
            
    if((!isset($_POST['prstreet'])) || (!isset($_POST['prcity'])) || (!isset($_POST['prstate'])) || (!isset($_POST['pramountpaid'])) || (!isset($_POST['prownerphone'])) || (!isset($_POST['prleaving'])) || (!isset($_POST['prrentpaid'])) || (!isset($_POST['prnotice'])) || (!isset($_POST['prmove'])) || (!isset($_POST['prbilled'])) || (!isset($_POST['prdate'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['prstreet']=$_POST['prstreet'];
        $data['prcity']=$_POST['prcity'];
        $data['prstate']=$_POST['prstate'];
        $data['pramountpaid']=$_POST['pramountpaid'];
        $data['prownerphone']=$_POST['prownerphone'];
        $data['prleaving']=$_POST['prleaving'];
        $data['prrentpaid']=$_POST['prrentpaid'];
        $data['prnotice']=$_POST['prnotice'];
        $data['prmove']=$_POST['prmove'];
        $data['prbilled']=$_POST['prbilled'];
        $data['prdate']=$_POST['prdate'];
        
        $data['prstreet']=strtolower($data['prstreet']);
        $data['prcity']=strtolower($data['prcity']);
        $data['prstate']=strtolower($data['prstate']);
        $data['pramountpaid']=strtolower($data['pramountpaid']);
        $data['prownerphone']=strtolower($data['prownerphone']);
        $data['prleaving']=strtolower($data['prleaving']);
        $data['prrentpaid']=strtolower($data['prrentpaid']);
        $data['prnotice']=strtolower($data['prnotice']);
        $data['prmove']=strtolower($data['prmove']);
        $data['prbilled']=strtolower($data['prbilled']);
        $data['prdate']=strtolower($data['prdate']);
    }
    
    if((!isset($_POST['pristreet'])) || (!isset($_POST['pricity'])) || (!isset($_POST['pristate'])) || (!isset($_POST['priamountpaid'])) || (!isset($_POST['priownerphone'])) || (!isset($_POST['prileaving'])) || (!isset($_POST['prirentpaid'])) || (!isset($_POST['prinotice'])) || (!isset($_POST['primove'])) || (!isset($_POST['pribilled'])) || (!isset($_POST['pridate'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['pristreet']=$_POST['pristreet'];
        $data['pricity']=$_POST['pricity'];
        $data['pristate']=$_POST['pristate'];
        $data['priamountpaid']=$_POST['priamountpaid'];
        $data['priownerphone']=$_POST['priownerphone'];
        $data['prileaving']=$_POST['prileaving'];
        $data['prirentpaid']=$_POST['prirentpaid'];
        $data['prinotice']=$_POST['prinotice'];
        $data['primove']=$_POST['primove'];
        $data['pribilled']=$_POST['pribilled'];
        $data['pridate']=$_POST['pridate'];
        
        $data['pristreet']=strtolower($data['pristreet']);
        $data['pricity']=strtolower($data['pricity']);
        $data['pristate']=strtolower($data['pristate']);
        $data['priamountpaid']=strtolower($data['priamountpaid']);
        $data['priownerphone']=strtolower($data['priownerphone']);
        $data['prileaving']=strtolower($data['prileaving']);
        $data['prirentpaid']=strtolower($data['prirentpaid']);
        $data['prinotice']=strtolower($data['prinotice']);
        $data['primove']=strtolower($data['primove']);
        $data['pribilled']=strtolower($data['pribilled']);
        $data['pridate']=strtolower($data['pridate']);
    }
    
    if((!isset($_POST['ceemployed'])) || (!isset($_POST['ceaddress'])) || (!isset($_POST['ceemployerphone'])) || (!isset($_POST['ceoccupation'])) || (!isset($_POST['cesupervisor'])) || (!isset($_POST['cemonthlygrosspay'])) || (!isset($_POST['cedateofemployment'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['ceemployed']=$_POST['ceemployed'];
        $data['ceaddress']=$_POST['ceaddress'];
        $data['ceemployerphone']=$_POST['ceemployerphone'];
        $data['ceoccupation']=$_POST['ceoccupation'];
        $data['cesupervisor']=$_POST['cesupervisor'];
        $data['cemonthlygrosspay']=$_POST['cemonthlygrosspay'];
        $data['cedateofemployment']=$_POST['cedateofemployment'];
        
        $data['ceemployed']=strtolower($data['ceemployed']);
        $data['ceaddress']=strtolower($data['ceaddress']);
        $data['ceemployerphone']=strtolower($data['ceemployerphone']);
        $data['ceoccupation']=strtolower($data['ceoccupation']);
        $data['cesupervisor']=strtolower($data['cesupervisor']);
        $data['cemonthlygrosspay']=strtolower($data['cemonthlygrosspay']);
        $data['cedateofemployment']=strtolower($data['cedateofemployment']);
    }
    
    if((!isset($_POST['preemployed'])) || (!isset($_POST['preaddress'])) || (!isset($_POST['preemployerphone'])) || (!isset($_POST['preoccupation'])) || (!isset($_POST['presupervisor'])) || (!isset($_POST['premonthlygrosspay'])) || (!isset($_POST['predateofemployment'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['preemployed']=$_POST['preemployed'];
        $data['preaddress']=$_POST['preaddress'];
        $data['preemployerphone']=$_POST['preemployerphone'];
        $data['preoccupation']=$_POST['preoccupation'];
        $data['presupervisor']=$_POST['presupervisor'];
        $data['premonthlygrosspay']=$_POST['premonthlygrosspay'];
        $data['predateofemployment']=$_POST['predateofemployment'];
        
        $data['preemployed']=strtolower($data['preemployed']);
        $data['preaddress']=strtolower($data['preaddress']);
        $data['preemployerphone']=strtolower($data['preemployerphone']);
        $data['preoccupation']=strtolower($data['preoccupation']);
        $data['presupervisor']=strtolower($data['presupervisor']);
        $data['premonthlygrosspay']=strtolower($data['premonthlygrosspay']);
        $data['predateofemployment']=strtolower($data['predateofemployment']);
    }
    
    if((!isset($_POST['prieemployed'])) || (!isset($_POST['prieaddress'])) || (!isset($_POST['prieemployerphone'])) || (!isset($_POST['prieoccupation'])) || (!isset($_POST['priesupervisor'])) || (!isset($_POST['priemonthlygrosspay'])) || (!isset($_POST['priedateofemployment'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['prieemployed']=$_POST['prieemployed'];
        $data['prieaddress']=$_POST['prieaddress'];
        $data['prieemployerphone']=$_POST['prieemployerphone'];
        $data['prieoccupation']=$_POST['prieoccupation'];
        $data['priesupervisor']=$_POST['priesupervisor'];
        $data['priemonthlygrosspay']=$_POST['priemonthlygrosspay'];
        $data['priedateofemployment']=$_POST['priedateofemployment'];
        
        $data['prieemployed']=strtolower($data['prieemployed']);
        $data['prieaddress']=strtolower($data['prieaddress']);
        $data['prieemployerphone']=strtolower($data['prieemployerphone']);
        $data['prieoccupation']=strtolower($data['prieoccupation']);
        $data['priesupervisor']=strtolower($data['priesupervisor']);
        $data['priemonthlygrosspay']=strtolower($data['priemonthlygrosspay']);
        $data['priedateofemployment']=strtolower($data['priedateofemployment']);
    }
            
    if((!isset($_POST['savingbank'])) || (!isset($_POST['savingdeposit'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['savingbank']=$_POST['savingbank'];
        $data['savingdeposit']=$_POST['savingdeposit'];
        
        $data['savingbank']=strtolower($data['savingbank']);
        $data['savingdeposit']=strtolower($data['savingdeposit']);
    }
    
    if((!isset($_POST['checkingbank'])) || (!isset($_POST['checkingdeposit'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['checkingbank']=$_POST['checkingbank'];
        $data['checkingdeposit']=$_POST['checkingdeposit'];
        
        $data['checkingbank']=strtolower($data['checkingbank']);
        $data['checkingdeposit']=strtolower($data['checkingdeposit']);
    }  
    
    if((!isset($_POST['creditinstitution'])) || (!isset($_POST['creditowed'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['creditinstitution']=$_POST['creditinstitution'];
        $data['creditowed']=$_POST['creditowed'];
        
        $data['creditinstitution']=strtolower($data['creditinstitution']);
        $data['creditowed']=strtolower($data['creditowed']);
    }

   if((!isset($_POST['loaninstitution'])) || (!isset($_POST['loanowed'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $data['loaninstitution']=$_POST['loaninstitution'];
        $data['loanowed']=$_POST['loanowed'];
        
        $data['loaninstitution']=strtolower($data['loaninstitution']);
        $data['loanowed']=strtolower($data['loanowed']);
    }      
        
    if((!isset($_POST['car1make'])) || (!isset($_POST['car1model'])) || (!isset($_POST['car1color'])) || (!isset($_POST['car1year'])))
    //if((!isset($_POST['car1make'])) || (!isset($_POST['car1model'])) || (!isset($_POST['car1color'])) || (!isset($_POST['car1year'])) || (!isset($_POST['car1licenseplate'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
            $data['car1make']=$_POST['car1make'];
            $data['car1model']=$_POST['car1model'];
            $data['car1color']=$_POST['car1color'];
            $data['car1year']=$_POST['car1year'];
            //$data['car1licenseplate']=$_POST['car1licenseplate'];
            
            $data['car1make']=strtolower($data['car1make']);
            $data['car1model']=strtolower($data['car1model']);
            $data['car1color']=strtolower($data['car1color']);
            $data['car1year']=strtolower($data['car1year']);
            //$data['car1licenseplate']=strtolower($data['car1licenseplate']);
    }

   // if((!isset($_POST['car2make'])) || (!isset($_POST['car2model'])) || (!isset($_POST['car2color'])) || (!isset($_POST['car2year'])) || (!isset($_POST['car2licenseplate'])))
    if((!isset($_POST['car2make'])) || (!isset($_POST['car2model'])) || (!isset($_POST['car2color'])) || (!isset($_POST['car2year'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
            $data['car2make']=$_POST['car2make'];
            $data['car2model']=$_POST['car2model'];
            $data['car2color']=$_POST['car2color'];
            $data['car2year']=$_POST['car2year'];
            //$data['car2licenseplate']=$_POST['car2licenseplate'];
            
            $data['car2make']=strtolower($data['car2make']);
            $data['car2model']=strtolower($data['car2model']);
            $data['car2color']=strtolower($data['car2color']);
            $data['car2year']=strtolower($data['car2year']);
            //$data['car2licenseplate']=strtolower($data['car2licenseplate']);
    }
    
    
    if((!isset($_POST['app2'])) || (!isset($_POST['dname'])) || (!isset($_POST['dstreet'])) || (!isset($_POST['dcity'])) || (!isset($_POST['dstate'])) || (!isset($_POST['dphone'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
            $data['app2']=$_POST['app2'];
            $data['dname']=$_POST['dname'];
            $data['dstreet']=$_POST['dstreet'];
            $data['dcity']=$_POST['dcity'];
            $data['dstate']=$_POST['dstate'];
            $data['dphone']=$_POST['dphone'];
            
            $data['app2']=strtolower($data['app2']);
            $data['dname']=strtolower($data['dname']);
            $data['dstreet']=strtolower($data['dstreet']);
            $data['dcity']=strtolower($data['dcity']);
            $data['dstate']=strtolower($data['dstate']);
            $data['dphone']=strtolower($data['dphone']);
    }
        
    if((!isset($_POST['lname'])) || (!isset($_POST['lstreet'])) || (!isset($_POST['lcity'])) || (!isset($_POST['lstate'])) || (!isset($_POST['lphone'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);  
        die('You did not form fully.');        
    }
    else
    {
            $data['lname']=$_POST['lname'];
            $data['lstreet']=$_POST['lstreet'];
            $data['lcity']=$_POST['lcity'];
            $data['lstate']=$_POST['lstate'];
            $data['lphone']=$_POST['lphone'];
            
            $data['lname']=strtolower($data['lname']);
            $data['lstreet']=strtolower($data['lstreet']);
            $data['lcity']=strtolower($data['lcity']);
            $data['lstate']=strtolower($data['lstate']);
            $data['lphone']=strtolower($data['lphone']);
    }
    
    if((!isset($_POST['rname'])) || (!isset($_POST['rstreet'])) || (!isset($_POST['rcity'])) || (!isset($_POST['rstate'])) || (!isset($_POST['rphone'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);  
        die('You did not form fully.');        
    }
    else
    {
            $data['rname']=$_POST['rname'];
            $data['rstreet']=$_POST['rstreet'];
            $data['rcity']=$_POST['rcity'];
            $data['rstate']=$_POST['rstate'];
            $data['rphone']=$_POST['rphone'];
            
            $data['rname']=strtolower($data['rname']);
            $data['rstreet']=strtolower($data['rstreet']);
            $data['rcity']=strtolower($data['rcity']);
            $data['rstate']=strtolower($data['rstate']);
            $data['rphone']=strtolower($data['rphone']);
    }  

    if((!isset($_POST['laterent'])) || (!isset($_POST['nonsmoking'])) || (!isset($_POST['renttime'])) || (!isset($_POST['bankruptcy'])) || (!isset($_POST['bankruptcywhen'])) || (!isset($_POST['movein'])) || (!isset($_POST['felony'])) || (!isset($_POST['evictionnotice'])) || (!isset($_POST['evictionwhen'])) || (!isset($_POST['pets'])))
    {
        $ch = curl_init("https://tarterbrothers.com/filled-form-incorrectly/");
        curl_exec($ch);
        die('You did not form fully.');        
    }
    else
    {
        $laterent=$_POST['laterent'];
        $data['nonsmoking']=$_POST['nonsmoking'];
        $data['renttime']=$_POST['renttime'];
        $bankruptcy=$_POST['bankruptcy'];
        $data['bankruptcywhen']=$_POST['bankruptcywhen'];
        $data['movein']=$_POST['movein'];            
        $felony=$_POST['felony'];
        $evictionnotice=$_POST['evictionnotice'];                        
        $data['evictionwhen']=$_POST['evictionwhen'];
        $data['pets']=$_POST['pets'];
        
        $laterent=strtolower($laterent);
        $data['nonsmoking']=strtolower($data['nonsmoking']);
        $data['renttime']=strtolower($data['renttime']);
        $bankruptcy=strtolower($bankruptcy);
        $data['bankruptcywhen']=strtolower($data['bankruptcywhen']);
        $data['movein']=strtolower($data['movein']);            
        $felony=strtolower($felony);
        $evictionnotice=strtolower($evictionnotice);                        
        $data['evictionwhen']=strtolower($data['evictionwhen']);
        $data['pets']=strtolower($data['pets']);
    }
        

Aucun commentaire:

Enregistrer un commentaire