if online php
_name == '') ? $redText : ''; ?>
Here is what the above code is Doing:
1. It’s checking to see if the $_POST[‘name’] variable is empty.
2. If it is, it’s setting the $redText variable to the HTML code for a red asterisk.
3. It’s then using the $redText variable in the HTML code for the form.
The result is that if the user doesn’t enter a name, the form will be redisplayed with a red asterisk next to the name field.
The code for the email field is similar: