PHP Email Send Filter question

I am stuck on this filter working


if($_POST['State']=="FL" AND ['Amount']=="400000+")
    {
	$cc_tomail[0]="";
    }

I tired the above but it does not work. I can get it to work alone with the state.

I want the formmail to filter this and send to a specific email.

You forgot $_POST infront of [‘Amount’]

Thanks I see that and corrected it but it still does not filter properly.
It still comes through if it is 200000 or 400000.
I also tried to use use >400000

put var_dump($_POST); above your IF statement and post the output it produces for both of those options.

That gave me an error msg and still went through.

Lukkas,

Try to be as as detailed as possible when mentioning “errors”. Without supplying the error message and new source code used, in any case when trying to get help, stops us from moving forward in our attempts to help out.

from a php formmail script trying to filter with numbers



// recipient info
	$charset[0]="UTF-8";
	$tomail[0]="example@yahoo.com";
        var_dump($_POST);
	if($_POST['State']=="Texas" OR $_POST['State']=="Illinois" AND  $_POST['Amt'] >"417000"){
	$cc_tomail[0]="";
	$bcc_tomail[0]="test@yahoo.com";
	}

I get this warning:
Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/site.com/submit/mail.php:21) in /home/public_html/site.com/submit/mail.php on line 575

that particular line in the mail.php is: header("Location: ".$thanks_page[$config]);

hope that helps

Thanks

Okay. What that error means is that you have already outputted data to the screen, so it cant send a header (one was already created). You dont want to forward from that page at the moment anyway because you want to be able to read the var_dump that is produced. so lets run this code:


// recipient info
    $charset[0]="UTF-8";
    $tomail[0]="example@yahoo.com";
        var_dump($_POST);exit; //added exit
    if($_POST['State']=="Texas" OR $_POST['State']=="Illinois" AND  $_POST['Amt'] >"417000"){
    $cc_tomail[0]="";
    $bcc_tomail[0]="test@yahoo.com";
    }

the program will exit before anythign else, allowing you to see the var dump

Yes, it allows me to see a var dump. now the thank you page does not show only the dumped fields when submitting. No email is received either

Copy and paste the output from the var_dump here for us to see. We need to see the data it is spitting out.

it is a form-mail script with many fields and it is spitting all those out when click submit.
Not really what I was looking for. I just wanted a filter based on numbers input in a field.
I don’t understand what relationship it has filtering

Okay, we need to see that information to be able to help you. Unless I see what is being stored in [‘Amount’], I can’t fix your code. I want you to copy and paste what it writes to the screen in a response here so I can see how to fix your code.