I am trying to highlight the textboxes that are empty using ONLY php/html. Currently the background of the page changes color not the textbox. My question is how to define the PHP in the html tags
PHP:
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["fname"])) {
$fname = "<div style='background-color:red'</div>";
} else {
$fname = test_input($_POST["fname"]);
}
HTML:
<div class = "group">
<label for="name">First Name</label><br/>
<input type="text" id="fname" name="fname">
<span class="error">* <?php echo $fnameErr;?></span>