weixin_33713707 2016-02-04 15:45 采纳率: 0%
浏览 26

POST 500(内部错误)php

I have this error.I've looked for solution in internet,but not found. enter image description here

function sendPhoto()
{
    var time = vaxt(new Date());

    $(".mes-all").append("<div class=\"mes-my\"><span class=\"mes-targering\"><span class=\"foto\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:30px;color:black\"></i></span></span><span style=\"display:inline\" class=\"mes-my-tr\">"+time+" <i class=\"fa fa-spinner fa-spin\" style=\"margin-left: 4px;\"></i></span></div>");

    scroll();

    var fd = new FormData();    

    fd.append( "file", $(".mes-sending-photo")[0].files[0]);
    fd.append( "to",$(".id").val());

    $.ajax({
        url: "ajax/sendPhoto.php",
        data: fd,
        processData: false,
        contentType: false,
        type: "POST",
        success: function(){
            getMessage();
        }
    });
}

I think problem is at server side not at codes,but also I can't find. error response: Remote Address:46.17.40.62:80
Request URL:http://masters.az/ajax/sendPhoto.php Request Method:POST Status Code:500 Internal Server Error Request Headersview parsed POST /ajax/sendPhoto.php HTTP/1.1 Host: masters.az Connection: keep-alive Content-Length: 159591 Accept: / Origin: http://masters.az X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36 Content-Type: multipart/form-data; boundary=----
WebKitFormBoundaryB8Wq6VD8CcBe7y9A Referer: http://masters.az/message-4

Accept-Encoding: gzip,deflate

Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4

Cookie: login=fuad; parol=12345; id=2; cuid=Mw%3D%3D;

cups=ac4b3abea4ff5ffb14f92d05d18f3c68; login=fuad; parol=12345; id=2;

session=P7ytO93YItgRjUerd5PgJmrO5gN7KIrjPpdlweIDVyeFRG44LTkeDa0IGONagEI4
Request Payload
------WebKitFormBoundaryB8Wq6VD8CcBe7y9A

Content-Disposition: form-data; name="file"; filename="logo.jpg"

Content-Type: image/jpeg

------WebKitFormBoundaryB8Wq6VD8CcBe7y9A

Content-Disposition: form-data; name="to"

4

------WebKitFormBoundaryB8Wq6VD8CcBe7y9A--

Response Headersview source

Connection:close

Content-Length:594

Content-Type:text/html

Date:Thu, 04 Feb 2016 16:40:13 GMT

Server:nginx/1.6.2

The php code is(that content sending by via ajax):

<?php
if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
ini_set('display_errors', 1);
error_reporting(E_ALL);
require("../inc/core.php");
$file=$_FILES['file'];
$tip=$file['type'];
$size=$file['size'];
$t=time();
$yer="../files/mes_images/".$t."_big.png";
$access_size=5*(1000000);
$access_type=array("image/gif","image/jpg","image/jpeg","image/pjpeg","image/x-png","image/png");
if(in_array($tip,$access_type) && $size<=$access_size && !empty($file['name'])){
$q=move_uploaded_file($file['tmp_name'],$yer);
echo $q?"ok":"no";
resize($yer,null,100,100,false,"../files/mes_images/".$t.".png",false,false,100);

$mes="[img]../files/mes_images/".$t.".png[/img]";
$to=$_POST['to'];

$block=leo::mfa("select * from blok where (`by`='$usid' && `to`='$to') || (`by`='$to' && `to`='$usid')  ");
if(!$block){
$check=leo::mfa("select * from `mail` where (`by`='$usid' && `to`='$to') || (`by`='$to' && `to`='$usid') ");
if($check){
$cid=$check['cid'];
}else{
$scid=leo::mfa("select * from `mail` order by cid desc limit 1");
$cid=$scid?$scid['cid']+1:1;
}

$qu=leo::mq("insert into `mail` set `by`='$usid',`to`='$to',mesaj='$mes',vaxt='".time()."',oxu='yox',cid='$cid'");



}


}

}else{
header("location:../err?err=303");
}
?>
  • 写回答

0条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 GEO下载数据的处理报错 :函数‘Meta’标签‘"data.frame"’找不到继承方法,如何解决?
      • ¥15 DLNM模型是否可以用二分类变量作为y变量
      • ¥15 android object box 一个实体多个表怎么写
      • ¥15 temux 启用docker 服务失败
      • ¥15 Flask 使用celery发送邮件出现‘目标计算机积极拒绝‘
      • ¥60 老人用的sd卡在手机里面不知道操作了什么,导致图片和视频变成了文件,取下sd卡连接电脑就是图中的样子,后缀改为.jpg才可以,需要用系统的画图软件才能打开,文件属性还是文件,有没有批量操作的解决办法
      • ¥15 超时跳出方法代码的返回值问题
      • ¥15 汇编语言程序设计设计,ascii码求数,再求数的BCD码
      • ¥30 Mask rcnn训练自己的数据集出现问题!
      • ¥20 研究人工智能时的几个问题