My code is working fine and inserting data to the database without any issue, except that the md5 password is getting inserted as the plain text. Echo ing out the md5 password is showing the hashed password. Please see the code below. I'm not able to find the issue.
<?php if(isset($_POST['signup'])){ $email = $_POST['email']; $pass = $_POST['password']; $screenname = $_POST['screenName']; if(empty($email) || empty($pass) || empty($screenname)){ $error.="Please fill all the fields"; }else{ //Sanitize the data $email = $getFromUsers->checkVar($email); $pass = md5($getFromUsers->checkVar($pass)); echo $pass; $screenname = $getFromUsers->checkVar($screenname); //Check if email format i correct if(!filter_var($email,FILTER_VALIDATE_EMAIL)){ $error.="Please provide valid email"; }else if(strlen($screenname)>20 || strlen($screenname)<6){ $error.="Screen Name should have 6-20 Charaters"; }else if(strlen($pass)<5){ $error.="Password too weak"; }else{ //If all ok, then check if email is available if($getFromUsers->checkEmailAvail($email)===true){ $getFromUsers->create('users',array('username'=>$screenname,'email'=>$email,'password'=>$pass,'screenName'=>$screenname)); //header('location:./home.php'); }else $error.="Email not available"; } } } ?>