How do i apply a class (stlyesheet class) to the code below. I tried wrapping <span> tags around the php code, but it didn't work. Note: the code below is in html code <?php } else { echo "No county selected... Please select a county\n"; ?> PHP:
If you wrapped <span> elements around those two php tags, it wouldn't work because the first span would be lying within the first section of conditional code (You can create conditional statements for HTML code too, i.e. <?php if($a==1) { ?> Hello <?php } else { ?> Goodbye <?php } ?> Code (markup): would work just fine. Try adding the <span> tags inside the echo statement, like echo "<span class='cssstyle'>No county selected... Please select a county</span>\n"; Code (markup):
Agrees with Clouberries... the php tags tell the server what to process, the echo is what is goig to be what is written to the output file.