Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( isset($_POST['username']) && isset($_POST['password']) ) {
- $con = mysql_connect("localhost","db_usiswa","password");
- if (!$con)
- {
- die('Could not connect : ' . mysql_error());
- }
- mysql_select_db("db_siswa", $con);
- $sql="select * from tbl_login where username = '" . $_POST['username'] . "' and password = '" . $_POST['password']. "'";
- $query=mysql_query($sql);
- if($query){
- $arr_sukses = array ('response'=>'SuksesLogin');
- echo json_encode($arr_sukses);
- }else {
- $arr_gagal = array ('response'=>'GagalLogin');
- echo json_encode($arr_gagal);
- }
- } else{
- echo "No Post Here";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment