What I want to do is whenever a user selects a picture and click the button it will move the image to a specific folder and save the link to the database user_image column.<
Take a look at this http://malsup.com/jquery/form/#ajaxSubmit.
Include that plugin jquery.form.js
and then try this.
$('#FormID').ajaxSubmit({ //FormID - id of the form.
type: "POST",
url: "Oppa/view/photo.php",
data: $('#FormID').serialize(),
cache: false,
success: function (response) {
if (Number(response) == 1)
{
$("#dialog-confirm-changedImage").dialog("open");
}
}
});
This should work. I'm using it for ajax image upload.
Thanks.