php中上传代码中的逻辑错误 [英] logical error in upload code in php

查看:79
本文介绍了php中上传代码中的逻辑错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的用户

我在php中写了一个文件上传代码,代码工作正常,但它会将文件上传50kb到60kb,当我尝试上传超过50kb到60kb的文件然后页面卡在加载。

问题是为什么它不上传超过60kb的文件?我的代码有任何问题请查看..



我的form.php代码是......





Dear user
I write a file upload code in php, the code work's fine but it will upload the file 50kb to 60kb, when i try to upload more then 50kb to 60 kb file then the page stuck on loading.
The problem is why it is not uploading more then 60kb file? is there any fault in my code please check it out..

My form.php code is...


<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="css/bootstrap.css"/>
    <link rel="stylesheet" href="css/bootstrap.min.css"/>
</head>
<body>
<div class="col-md-6">


<form action="upload.php" method="post" enctype="multipart/form-data">
    <label for="">Item</label><br />
   <input type="file" name="picture" class="form-control"><br />
    
    <label for="">Description</label><br />
    <textarea name="description" id="" placeholder="Enter Item Description" class="form-control"  cols="50" rows="20"></textarea><br />

    <input type="submit" name="submit" value="Upload" class="btn btn-success">
</form>
</div>
<script src="js/bootstrap.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery-2.1.1.min.js"></script>
</body>
</html>





我的upload.php代码是









my upload.php code is



include 'conn.php';<br />
$desc=$_POST['description'];<br />
$image=$_FILES['picture'];<br />
$image_name=$_FILES['picture']['name'];<br />
$placed='uploads/';<br />
if(move_uploaded_file($_FILES['picture']['tmp_name'],$placed.$image_name))<br />
{<br />
    $smt=$conn->prepare("INSERT INTO images(Image_Name,Description,Placed_On)VALUES('".$image_name."','".$desc."','".$placed."')");<br />
    $smt->execute();<br />
    header('location:form.php');<br />
   <br />
}<br />
else<br />
{<br />
    echo 'error on uploading file';<br />
}<br />
?>





谢谢..



Thanks..

推荐答案

desc =


_POST ['description'];< br />
_POST['description'];<br />


image =


这篇关于php中上传代码中的逻辑错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆