I just can’t get my head around it. What do I need to write in my php file to return something to the $.post function?
<script type="text/javascript">
function SubmitToDatabase(uName, uComment)
{
$.post("write_something_to_mysql_b.php", {name: uName, comment: uComment});
return false;
}
</script>
This works, but there is no return value from the PHP file
jsonis just one of the possibilities to require data from backend side. Others are: xml, json, script, text, html. For each one of these formats you must to return data from backend in a suitable way. For example fortextjustecho 'hello!!!; exit;