Imi puteti spune de ce primesc erorile astea:
Cod: Selectaţi tot
Notice: Constant DESTINATION already defined in C:\wamp64\www\index.php on line 9
Notice: Constant RESIZEBY already defined in C:\wamp64\www\index.php on line 10
Notice: Constant RESIZETO already defined in C:\wamp64\www\index.php on line 11
Notice: Constant QUALITY already defined in C:\wamp64\www\index.php on line 12
Cod: Selectaţi tot
<?php
$error = false;
if(isset($_FILES['upload']) === true)
{
for($i=0; $i<count($_FILES['upload']['name']); $i++)
{
if(is_file($_FILES['upload']['tmp_name'][$i]))
{
define('DESTINATION', 'images/');
define('RESIZEBY', 'w');
define('RESIZETO', $_POST['width']);
define('QUALITY', 100);
require_once 'image.class.php';
$image = new Image($_FILES['upload']['tmp_name'][$i]);
$image->destination = DESTINATION.$_FILES['upload']['name'][$i];
$image->constraint = RESIZEBY;
$image->size = RESIZETO;
$image->quality = QUALITY;
$image->render();
}
}
echo '<br/>';
echo 'Image successfully resize and upload to folder';
}
?>