小编All*_* Yu的帖子

文件上传php语法错误

我正在尝试让这段代码再次运行.即使我正在尝试访问的文件名,我做了一些不回显的内容.请帮忙,我已经看了一个多小时已经没有用了:(注意:我甚至不能在这里回应$ name

<?php 
    error_reporting(0);
    if($_POST['submit']){
        //file uploading 
        $name = basename($_FILES['upload']['name']); //name plus extention
        print_r($_FILES['upload']);
        $t_name = $_FILES['upload']['tmp_name'];
        $dir = 'gallery_i';
        $thumbs = 'gallery_t';

        if(move_uploaded_file($t_name,$dir.'/'.$name)){
            $resizeObj = new resize($dir.'/'.$name);//Resize image (options: exact, portrait, landscape, auto, crop)
            $resizeObj -> resizeImage(200, 200, 'auto'); //Save image
            $resizeObj -> saveImage($thumbs.'/'.$name, 100);
            echo 'file upload nicely';
            //file upload successfull           
        }           
}
?>


<div class='home'>
    <form method='post' action='other.php'>
        Name: <input class='reg' type='text' name='prodname'/><br/><br/>
        Description:<br/> <textarea class='reg' name='description' rows="4" cols="40">                </textarea> <br/><br/>
        <input type='file' name='upload' />
        <input type='submit' …
Run Code Online (Sandbox Code Playgroud)

php

1
推荐指数
1
解决办法
745
查看次数

标签 统计

php ×1