I need your help .. I'm trying to make the text box red when there is a form error ...
This is what I can do. But when I send to the front, I get the Undefined Index error_css in the form
if (isset($_POST['submit'])) {
if (empty($_POST['username'])) {
$error_css='background-color:red';
}
The form
<label for="username">Username:</label>
<input id="username" type="text" value="<?php if(isset($_POST['username'])){ echo $_POST['username']; } ?>" name="username" title='Username' />
thank you for your time...
user652792
source
share