You can easily upload an image through form in PHP.
You need to add JavaScript file for send image data on server side through AJAX.
Please add query.form.js in your code. You may download this js file form following link:
https://github.com/malsup/form/
http://plugins.jquery.com/form/
The javascript code look like:
var options = {
url: "path of file",
beforeSend: function()
{
},
uploadProgress: function(event, position, total, percentComplete)
{
},
success: function(data)
{
},
complete: function(response)
{
},
error: function()
{
}
};
$("#form").ajaxForm(options);
$("#form").submit();
Write normal HTML code and file upload code on PHP side.
Cheers :)
0 Comment(s)