I have an image cropping script that crop one image at a time using the jQuery Jcrop plugin . now I want to load more images and crop them one by one using the for loop.
What is the best way to do this?
I set several for my input field so that it can load more than one.
EDIT:
I changed the code below with $maxand count. and I think I'm doing it wrong. how can I fix it, so when I click on the cropping, he visits them after each other.
This is mine uploaded.php:
<?php
session_start();
$max = count($_FILES['userfile']['name']);
for($i = 0; $i < $max; $i++){
$target = $_FILES['file'][$i];
}
$target = "data/uploads/";
$target = $target . basename( $_FILES['filename']['name']) ;
$_SESSION['target_path'] = $target;
$ok=1;
if(move_uploaded_file($_FILES['filename']['tmp_name'], $target))
{
echo "De afbeelding *". basename( $_FILES['filename']['name']). "* is geupload naar de map 'uploads'";
}
else
{
echo "Sorry, er is een probleem met het uploaden van de afbeelding.";
}
?>
Thank!
source
share