php - Error with passing parameters -


when passing parameters login function in authenticate class these errors:

notice: undefined index: user in c:\users\adam\phpstormprojects\website\login.php on line 11 notice: undefined index: pass in c:\users\adam\phpstormprojects\website\login.php on line 12

this function in authenticate class

 public function login($user,$pass){} 

and login.php params getting passed from.

 $authenticateuser = new authenticate();  $queryresult = $authenticateuser->login(($email),($password)); 

does understand why getting these errors?

check html form has input fields make sure having correct tags names.

<input type="text" name= "user" value=""/> <input type="text" name= "pass" value=""/> 

and make sure passing post in method="post" not get.

then print $_post , $_get first thing on php page , exit() check if getting input.

print_r($_post); print_r($_get); die("done..."); 

then must validate post array see if user typing in form , not submitting empty. guess have validation class can use framework, if not, @ least validate plainly.

if(isset($_post["user"]) && !empty($_post["user"]) && strlen($_post["user"])>1) {  //do stuff }  else { //show error } 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -