Jump to content

[SOLVED] php if statement error


NathanS

Recommended Posts

Hi there everyone:

 

I have a problem and I just can't figure it out! $AVALUE will return either Yes or No based on what the customer selects in a <select> list option. I have tested that the variable outputs correctly, and it does. However, in the following script, it always says error (the else statement) rather than the first two. Any ideas?

 

Thanks!!

 

$AVALUE = "".$_POST["AVALUE"]."\n";

if ($AVALUE == "Yes") {
	echo "<BR>";
	echo "<P>The valuation has now been agreed, and an email dispatched to Business Support</P>";
	echo "<P><a href='panel.php'><img src='undo.png' border='0'></a><BR /><B>Back to panel</B></a></P>";
	echo "<BR>";
	$msg = "Registration Number: ".$_POST["REGNO"]."\n";
	$msg .= "First Name: ".$_POST["FNAME"]."\n";
	$msg .= "Last Name: ".$_POST["LNAME"]."\n";
	$msg .= "Postcode: ".$_POST["PCODE"]. "\n";
	$msg .= "Value: ".$_POST["VVALUE"]. "\n";
	$recipient = "[email protected]";
	$subject = "Valuation Agreed";
	$mailheaders = "From: Herts Insurance Consultants LTD <[email protected]> \n";
	mail($recipient, $subject, $msg, $mailheaders);

} elseif ($AVALUE == "No") {
	echo "<BR>";
	echo "You have chosen to decline the Agreed Valuation Request. Please e-mail the customer to inform them of this 

decision, and the appropriate reasoning behind it. This record will remain in Unactioned AV's - Please make a note of this case so as 

not to mistake this for a new entry. The ID Number is '$id'. ";
	echo "<BR>";
	echo "<P><CENTER><a href='panel.php'><img src='undo.png' border='0'></a><BR /><B>Back to panel</B></a></CENTER></P>";
	echo "<BR>";

} else {	

	echo "There has been an error, $AVALUE";

}

Link to comment
https://forums.phpfreaks.com/topic/53553-solved-php-if-statement-error/
Share on other sites

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.