foto=="") { $foto =""; } else { $foto = stripslashes($basepath."images/sekolah/pendaftar/".$hasil->foto); } $myObj->email = $hasil->email; $myObj->nama = $hasil->nama; $myObj->level = "Siswa"; $myObj->foto = $foto; $myObj->kode = $hasil->kode_sekolah; $myObj->paket = "no_paket"; $myJSON = json_encode($myObj); $myJSON_decode = json_decode($myJSON); $_SESSION['email'] = $myJSON_decode->{'email'}; $_SESSION['nama'] = $myJSON_decode->{'nama'}; $_SESSION['level'] = $myJSON_decode->{'level'}; $_SESSION['foto'] = $myJSON_decode->{'foto'}; $_SESSION['kode'] = $myJSON_decode->{'kode'}; $_SESSION['paket'] = $myJSON_decode->{'paket'}; if ($_SESSION['level']=="Siswa") { echo stripslashes($myJSON); } else { echo "null"; } ?>