Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php imagesx()不适用于当前目录外的图像_Php_Image_Upload - Fatal编程技术网

Php imagesx()不适用于当前目录外的图像

Php imagesx()不适用于当前目录外的图像,php,image,upload,Php,Image,Upload,我正在尝试使用调整大小代码上载图像。 我面临的问题是,当从同一文件夹上载图像时,图像的大小会得到完美调整。但是,当我从其他地方选择图像时,它会显示一组警告。我知道这可能是一个愚蠢的路径问题,但我无法纠正它。请帮忙 在HTML上上载的代码是: <form enctype="multipart/form-data" action="index.php" method="post"> <input type="file" name="image" /> &

我正在尝试使用调整大小代码上载图像。 我面临的问题是,当从同一文件夹上载图像时,图像的大小会得到完美调整。但是,当我从其他地方选择图像时,它会显示一组警告。我知道这可能是一个愚蠢的路径问题,但我无法纠正它。请帮忙

在HTML上上载的代码是:

   <form enctype="multipart/form-data" action="index.php" method="post">
    <input type="file" name="image" />
    <input type="submit" />
   </form>

您的表单代码在
index.php
文件中??否-表单在form.php上。操作页面是index.php
$resizeObj=newresize(“$fileVal1”)更改不正确的编号
$resizeObj->resizeImage(500300,'crop')
在这里,您的表单代码位于
index.php
文件中??否-表单位于form.php上。操作页面是index.php
$resizeObj=newresize(“$fileVal1”)更改不正确的编号
$resizeObj->resizeImage(500300,'crop')在这里
 <?php
  include_once("resize-class.php");
  $fileVal1 =   $_FILES['image']['name'];
  $resizeObj = new resize($fileVal1);
  $resizeObj -> resizeImage(500, 300, 'portrait');
  $resizeObj -> saveImage('sample-resized.gif', 100);
 ?>
 Warning: imagesx() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mgme-cms\resize\resize_class.php on line 17

 Warning: imagesy() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mgme-cms\resize\resize_class.php on line 18

 Warning: Division by zero in C:\xampp\htdocs\mgme-cms\resize\resize_class.php on line 106

 Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in C:\xampp\htdocs\mgme-cms\resize\resize_class.php on line 59

 Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mgme-cms\resize\resize_class.php on line 60

 Warning: imagegif() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mgme-cms\resize\resize_class.php on line 206

 Warning: imagedestroy() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mgme-cms\resize\resize_class.php on line 229