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 ("firstname.lastname@example.org", "Contact page feedback!", $message, "From: email@example.com"); ?>
…acknowledgment html…<?php else: ?>
…error html…<?php endif; ?>