I have a page where I need to have a "show function" where I click on a button, and then it will show the user information based on the id from the button.
I have this js code
$("#brugeridbtn").click(function(){
var id = $("#brugerid").val();
console.log( id );
$.ajax({
type: 'POST',
url: 'test.php',
data: {
'id': '1'
},
success: function(msg){
alert('wow' + msg.id);
}
});
});
And this is my form
<form method='POST'>
input type='hidden' name='brugerid' id='brugerid' value='$row[bruger_id]'>
<button type='button' class='btn btn-info' id='brugeridbtn' name='test' data-toggle='modal' data-target='#myModal'>Open Modal With Form</button>
</form>
Im stuck on how to get it to a $_POST so i can use it in the sql query.