I have this code to POST
value to main.php, with onclick function UserID will be called and value which is user_id should be changed based on selected value and load selected user_id
in user_profile.php?ID=user_id
var USER_ID = 0;
function UserID(user_id)
{
USER_ID = user_id;
$.ajax({
type: "POST",
url: "main.php",
data: {ID: USER_ID},
success: function(msg)
{
alert(USER_ID);
$('#user_profile_content').load('user_profile.php?ID=USER_ID #user_profile_content');
},
error: function()
{
alert("error");
}
});
}
After success post, alert is showing with selected value, it means POST
was successful but I don't know how to make user_profile.php?ID=USER_ID
to be changed based on received value. It's not replace global variable USER_ID
.