Answers to important questions about PHP and databases
Senior man, I clicked Login in login.html directly to usercontroller.php, and do not show anything, my purpose is to verify the successful login to jump directly to mian.html Unsuccessful then jump to error.html, but not successful, ask me what is wrong, there is a question is how to log on after the success of the login to mian.html? Thank you.
PHP Code
Login.html User System Login
PHP Code
dbconn.class.php
PHP Code
usermodel.php
Prepare ($sql);: $result->bind_param ("ss", $user _id, $user _password); $user _id= $userid; $user _password= $userpwd; $result->execute (); break; } Case ' student ': {$sql = "Select S_id,s_name,s_dep from Stu_info where s_id=? ands_pwd=?"; $result = $mysqli->prepare ($sql); $result->bind_param ("ss", $user _id, $user _password); $user _id= $userid; $user _password= $userpwd; $result->execute (); break; }} $result->bind_result ($user _id, $user _name, $user _DEP); while ($result->fetch ()) {$userlist =array (' user_id ' = $user _id, ' user_name ' = > $user _name, ' user_dep ' = $user _dep); } $result->close (); $mysqli->close (); return userlist; }?>