you would need to hand code this:
<?php
if(isset($_POST['CouponCode']) {
if($_POST['CouponCode'] != "ValidCode") {
$_SESSION['badCoupon'] = "yes";
} else {
$_SESSION['badCoupon'] = "no";
}
}
?>
then to show the error:
<?php if(isset($_SESSION['badCoupon']) && $_SESSION['badCoupon'] == "yes")) echo "you entered an incorrect coupon code"; ?>