$('.gethash').submit(function(e){
e.preventDefault();
$.ajax({
type:'POST',
url: base_url + 'ajax.php',
//dataType : "json",
data: $(this).serialize(),
success: function (data){
$('#test').html(data);
}
});
});
$test=$_POST['name'];
echo json_encode($test)
$('.gethash').submit(function(e){
e.preventDefault();
$.ajax({
type:'POST',
url: base_url + 'ajax.php',
//dataType : "json",
data: $(this).serialize(),
success: function (data){
data=JSON.parse(data);
$('#test').html(data['name']);
}
});
});
$test=$_POST['name'];
echo json_encode(array('name'=>$test));