I have a contact form and associated php script that worked together for years. A while back I thought of testing it and the script returns the if…else error based on an empty message. I’m not competent with forms or php but this is simple straightforward stuff and I just can’t see why it should fail, unless something basic as changed in php syntax? Can anyone spot the error?
Script:<?php if ($comments != ""): $message = "Name: " . $name . "\nEmail: " . $addy . "\n\n" . $comments . "\n"; mail ("email@example.com", "Contact page feedback!", $message, "From: firstname.lastname@example.org"); ?>
…acknowledgment html…<?php else: ?>
…error html…<?php endif; ?>