Skip to content

Instantly share code, notes, and snippets.

@kalvian1060
Created May 28, 2017 21:30
Show Gist options
  • Save kalvian1060/efb96204fa0d6d98f1beaa95a1cdf460 to your computer and use it in GitHub Desktop.
Save kalvian1060/efb96204fa0d6d98f1beaa95a1cdf460 to your computer and use it in GitHub Desktop.
<?php
include "../koneksi.php";
$fullname = $_POST['fullname'];
$username = $_POST['username'];
$password = $_POST['password'];
$sql ="INSERT INTO user VALUES (null,'$fullname','$username','$password')";
$query=mysql_query($sql);
$result = mysql_num_rows($query);
$hasil=array();
if($result==1){
$hasil['status']='success';
}else{
$hasil['status']='gagal';
}
$data = "{result:".json_encode($hasil)."}";
echo $data;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment