Today, We want to share with you PHP Ajax Image Upload Resize Crop using jQuery.In this post we will show you ajax image upload and crop with jquery and php, hear for Image Upload,Crop and Resize Using PHP, jQuery and Ajax we will give you demo and example for implement.In this post, we will learn about Live Image Upload, Crop and Resize using jQuery and PHP MySQL with an example.
PHP Ajax Image Upload Resize Crop using jQuery
There are the Following The simple About PHP Ajax Image Upload Resize Crop using jQuery Full Information With Example and source code.
As I will cover this Post with live Working example to develop PHP laravel crop image before upload, so the php image resize on upload for this example is following below.
Step 1: Javascript With Include External CDN
Javascript Source Code
Step 2 : HTML Interface
index.php
Step 3 : CREATE A Table
Users MySQL Table
CREATE TABLE `members` ( `uid` int(11) AUTO_INCREMENT PRIMARY KEY, `username` varchar(255) UNIQUE KEY, `password` varchar(100), `email` varchar(255) UNIQUE KEY, `profile_image` varchar(200) )
Step 4: jquery Ajax Call To server side
memberprofileimg.php
"; } //Original Image if(move_uploaded_file($livefileUpload, $path.$orignal_upload)) { //Insert upload image files names into user_uploads table mysqli_query($db,"UPDATE members SET profile_image='$orignal_upload' WHERE uid='$member_session_profile';"); echo ""; } else echo "failed"; } else echo "Image file size max 1 MB"; } else echo "Invalid file format.."; } else echo "Please select image..!"; exit; } ?>
Step 5 : Serever Side Resize with Compress an Image
resizewithCompressImg.php
Simple Your Images Re-sizing image into All the different some more pixel dimensions.
getExtension.php
function getExtension($captionstr) { $i = strrpos($captionstr,"."); if (!$i) { return ""; } $l = strlen($captionstr) - $i; $flext = substr($captionstr,$i+1,$l); return $flext; }
Step 6 : Database Config File
db.php
Simple Main Global file Database config file.
Angular 6 CRUD Operations Application Tutorials
Read :
Summary
You can also read about AngularJS, ASP.NET, VueJs, PHP.
I hope you get an idea about PHP Ajax Image Upload Resize Crop using jQuery.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.