Simple Login Example (PHP Server + Android Client)
Simple Login Example I have created this simple Login Example and intentionally leave it as the kind of login that is subject to hacking using SQL injection technique. I will discuss on SQL injection later. XAMP server side (PHP) Database create table users( userid varchar (20) primary key , password varchar (80) not null ); insert the data userid as 'test' and password as '1234' for testing INSERT INTO `users`(`userid`, `password`) VALUES ('test','1234') PHP Step 0: Create db_connect.php ( Refer to Lab2) Step1 :Create a loginTest.php <<< Server Side>>> loginTest.php <?php // check for post data if ( isset ( $_POST [ "id" ])) { $id = $_POST [ 'id' ]; $pw = $_POST [ 'pw' ]; // include db connect class require_once __DIR__ . '/db_connect.php' ; // connecting to db $db = new DB_CONNECT(); $db -> connect (); ...
Comments
Post a Comment