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

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 IDEA构建失败?怎么搞
      • ¥15 求该题的simpson,牛顿科特斯matlab代码,越快越好
      • ¥30 求解,有偿,可商量价格
      • ¥15 编译arm板子的gcc
      • ¥15 C++代码报错问题,c++20协程
      • ¥15 c++图Djikstra算法求最短路径
      • ¥15 Linux操作系统中的,管道通信问题
      • ¥15 ansible tower 卡住
      • ¥15 等间距平面螺旋天线方程式
      • ¥15 通过链接访问,显示514或不是私密连接