This article mainly introduces the simple login check class implemented by php, which can implement basic php database query and password matching functions. For more information, see
This article mainly introduces the simple login check class implemented by php, which can implement basic php database query and password matching functions. For more information, see
The example in this article describes the simple test login class implemented by php. Share it with you for your reference. The details are as follows:
<? Phpclass checklogin {var $ name; var $ pwd; function _ construct ($ username, $ password) {$ this-> name = $ username; $ this-> pwd = $ password;} function checkinput () {global $ db; $ SQL = "select * from tb_manager where and pwd = '$ this-> pwd '"; $ res = $ db-> query ($ SQL); $ info = $ db-> fetch_array ($ res ); if ($ info ['name'] = $ this-> name and $ info ['pwd'] = $ this-> pwd) {$ _ SESSION [admin_name] = $ info [name]; $ _ SESSION [pwd] = $ info [pwd]; echo" Script alert ('logon successful !); Window. location. href = 'index. php'; script ";} else {echo"