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 5 of 5
  1. #1
    New Coder
    Join Date
    Dec 2008
    Posts
    37
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Email Form Processing - Confirmation Issues

    I have installed a script called Dodosmail to handle my form processing. Everything works OK, but I would like to make two adjustments, and I am having a bit of difficulty.

    On the confirmation page and on the email I receive, I would like to omit the email confirmation and verification code confirmation fields, as they are just repetitive.

    The working form is here

    The PHP code is here

    The If statement that generates the information I need to modify is here:

    Code:
    if(in_array($actual_var, $reserved_vars))
    				echo "";
    			else {
    				if(is_array($$actual_var)) {
    					echo "<li>$actual_var: ";
    					foreach($$actual_var as $actual_val) {
    						echo "$actual_val ";
    					}
    					echo "</li>\n";
    				} else {
    					$actual_val = stripslashes($$actual_var);
    					echo "<li>$actual_var: $actual_val</li>\n";
    				}
    			}
    I've tried to add my own IF statements to pick out the Email2 and VerificationCode2 fields, but I can't get it to work. Any advice would be appreciated!

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    I copied the whole if block for context. I think you want to place your checks in the last nested else block.
    PHP Code:
        if(in_array($actual_var$reserved_vars)) {
            
    $inside_mail $inside_mail;
        } else {
            if(
    is_array($$actual_var)) {
                
    $inside_mail.= "$actual_var: ";
                foreach($
    $actual_var as $actual_val) {
                    
    $inside_mail.= "$actual_val ";
                }
                
    $inside_mail.= "\n";
            } else {
    /* NEW--> */    if ($actual_val != "Email" && $actual_val != "VerificationCode2") {
                    
    $actual_val stripslashes($$actual_var);
                    
    $inside_mail.= "$actual_var: $actual_val\n";
    /* NEW--> */    }
            }
        } 
    Are you a Help Vampire?

  • #3
    New Coder
    Join Date
    Dec 2008
    Posts
    37
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Using that block (just had to change the quoted variable values to $Email2 & $VerificationCode2). It seems to work except the 'Message' field that comes after the VerificationCode2 field seems to get lost...weird...not sure I understand why. Thanks for looking!

    Code:
    	if(in_array($actual_var, $reserved_vars)) {
    		$inside_mail = $inside_mail;
    	} else {
    		if(is_array($$actual_var)) {
    			$inside_mail.= "$actual_var: ";
    			foreach($$actual_var as $actual_val) {
    				$inside_mail.= "$actual_val ";
    			}
    			$inside_mail.= "\n";
    		} else {
    			if ($actual_val != $Email2 && $actual_val != $VerificationCode2) {
                    $actual_val = stripslashes($$actual_var);
                    $inside_mail.= "$actual_var: $actual_val\n";
    			}
    		}
    	}

  • #4
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    I don't understand why, either... unless the test values entered into the form were the same for email2 and message. For example, did you type something like "asdf" into every field to test? Since it's comparing variable values instead of input names, that could be an issue, and should be patched even if that isn't the cause of the current problem.
    Are you a Help Vampire?

  • #5
    New Coder
    Join Date
    Dec 2008
    Posts
    37
    Thanks
    1
    Thanked 0 Times in 0 Posts
    It looks like it is just an issue with where the statements are placed... that conditional sort of stops things; in other words, if I place the 'message' field above the Email2 and VerificationCode2 fields, it will work.

    http://www.adamfialkov.com/contact.php


  •  

    Posting Permissions

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