Jump to content

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 = "n.scott@hertsinsurance.com";
	$subject = "Valuation Agreed";
	$mailheaders = "From: Herts Insurance Consultants LTD <InternetQuote@hertsinsurance.com> \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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.