title: How to change input text color if it is blank submit by help of php and javascript?
body: <p>In index.php I have input area for emailId, php code to show error by user and my in login page I have php code to store user email id in database(mysql). And I don't want user submit blank email id to handle this problem I wrote "if (empty($uemail)){" but I want to show user input area is empty by changing changing border color of input text area into red.    </p>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>&lt;input type="email" id="email" name="email" placeholder="Email"&gt;
  
  &lt;?php
  session_start();
  if(isset($_SESSION['error'])){
  echo '&lt;script type="text/javascript"&gt;   
  function downIt() {
  document.getElementById("input").style.cssBorder = "color: red";
  }
  &lt;/script&gt;';
  }
  unset ($_SESSION['error']); 
  session_destroy ();
  ?&gt;
  </code></pre>
  
  <p><strong>login.php</strong></p>
  
  <pre><code>$uemail = $_POST['email'];
  if (empty($uemail)){
  $_SESSION['error'];
  Header( 'Location: index.php');
  exit;
  }
  else{
  query code....here....
  }
  </code></pre>