Jump to content

I have a problem with my form


ARUN CYBER SECURITY
 Share

Recommended Posts

sir I am arun   .And I have desigining a form and a have validating with php . but if I enter just space in all my form fields my validation dosen't   works  Please can give a solution html
     <input type="text" placeholder="name" name="fname"/> 
    if($_SERVER["REQUEST_METHOD"]=="POST"){
         $name=htmlspecialchars($_REQUEST["fname"]);
         $dat =htmlspecialchars($_REQUEST["dat"]);
         echo $name;
         if(empty($name)){
            echo"name is empty";
             
     }
     else{
         echo $name;
     }

Link to comment
Share on other sites

  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...