Hello, I have a function to insert a new user into the database and it returns an empty data from the page I use to post it with."Undefined" actually... Here is the code:
//insert new user into database
$("#insert_new_btn").live('click', function(){
var user_username = $("#insert_new_user").val;
$.ajax({
type: "POST",
url:"insert_nw_usr_script.php",
data:{insert_new_usr:user_username},
success:function(insert_a_user)
{$('#inserted_user').html(insert_a_user).show();}
});
});
This is the the php page, I haven't written the mysql script yet.I'm just printing the user on the screen, but I'm getting an empty response
<?php
$insert_new_usr = $_REQUEST['insert_new_usr'];
echo $insert_new_usr;
?>