dimanche 9 février 2020

Condition not passing

Hey guys iam having problem with my coding.

 <?php
if(isset($_POST["Submit"])){
  date_default_timezone_set("Asia/Karachi");
  $CurrentTime=time();
  $DateTime=strftime("%B-%d-%Y %H:%M:%S",$CurrentTime);

if(empty($Category)){
    $_SESSION["ErrorMessage"]= "All fields must be filled out";
    Redirect_to("categories.php");
  }
  elseif (strlen($Category)<4) {
      $_SESSION["ErrorMessage"]= "Category title should be greater than 4 characters";
      Redirect_to("categories.php");
    }
  }
  ?>

This is the code the elseif statement is not working or not processing when i fill the form with less than four characters.

Aucun commentaire:

Enregistrer un commentaire