2017-11-06 1 views
0

오늘이 오류를 보았습니다. 어제 모든 것이 좋았습니다. 호스팅 기반의 문제이거나 localhost에서 파일을 올바르게 실행하고 올바르게 작동하는지 모르겠습니다. 어쩌면 안전한 호스팅에 문제가 있습니까? 누군가가 어떤 조언을하면 매우 감사 할 것입니다.리소스를로드하지 못했습니다. 406 (허용되지 않음)

자원을로드하지 못했습니다 : 서버가 문서에서 406 (불가)

<?php 
if(isset($_SESSION["DATAGLOBAL"][0]) && !empty($_SESSION["DATAGLOBAL"][0])) 
    $C->LANGUAGE = $_SESSION["DATAGLOBAL"][0]; 
$this->load_langfile('inside/dashboard.php'); 
$this->load_langfile('global/global.php'); 
if($this->user->is_logged) 
{ 
    $D->is_logged = 1; 
    $errored  = 0; 
    $txterror  = ''; 
    $action  = 0; 
    $wsee   = -1; 
    $txtstatus  = $txtvalueatach = $txttypeattach = $id_wall  = ''; 
    $typeattach = $posted_in  = 0; 
    if(isset($_POST["wseep"]) && $_POST["wseep"] != -1) 
    { 
     $wsee = $this->db1->e($_POST["wseep"]); 
    } 
    if($wsee == -1) 
    { 
     $errored = 1; 
     $txterror = $this->lang('global_post_txterror6'); 
    } 
    if($errored == 0) 
    { 
     if(isset($_POST["pin"]) && $_POST["pin"] != '') 
     { 
      $posted_in = $this->db1->e($_POST["pin"]); 
     } 
     if(isset($_POST["idw"]) && $_POST["idw"] != '') 
     { 
      $id_wall = $this->db1->e($_POST["idw"]); 
     } 
     if(isset($_POST["newstatus"]) && $_POST["newstatus"] != '') 
     { 
      $txtstatus = $this->db1->e(htmlspecialchars($_POST["newstatus"])); 
     } 
     if(isset($_POST["typeattach"]) && $_POST["typeattach"] != 0) 
     { 
      $typeattach = $this->db1->e($_POST["typeattach"]); 
     } 
     if(isset($_POST["atach-value"]) && $_POST["atach-value"] != '') 
     { 
      $txtvalueatach = $this->db1->e($_POST["atach-value"]); 
     } 
     $withattach = 0; 
     $endtxtatach = ''; 
     $codep  = uniqueCode(11, 1, 'posts', 'code'); 
     if($typeattach == 1 || $typeattach == 2 || $typeattach == 3 || $typeattach == 4 || $typeattach == 5 || $typeattach == 6 || $typeattach == 7 || $typeattach == 8 || $typeattach == 9) 
     { 
      switch($typeattach) 
      { 
       case 1: 
        $images_post = $_FILES['images_post']; 
        $numphotos = count($images_post['name']); 
        if($images_post['name'][0]) 
        { 
         if($numphotos > $C->NUM_PHOTOS_POST) 
         { 
          $errored = 1; 
          $txterror = $this->lang('global_post_txterror1') . ' ' . $C->NUM_PHOTOS_POST; 
         } 
         else 
         { 
          $photos  = array(); 
          $tmp_photos = array(); 
          for($i = 0; $i < $numphotos; $i++) 
          { 
           if($images_post['size'][$i] > $C->SIZE_PHOTO || $images_post['size'][$i] == 0) 
           { 
            $errored = 1; 
            $txterror = $this->lang('global_post_txterror2') . ': ' . $images_post['name'][$i]; 
            break; 
           } 
           $loadedtype = $images_post['type'][$i]; 
           if($loadedtype == "image/jpeg" || $loadedtype == "image/gif" || $loadedtype == "image/png" || $loadedtype == "video/m4v") 
           { 
            switch($loadedtype) 
            { 
             case "image/jpeg": 
              $uploadfile .= '.jpg'; 
              $mfilename .= '.jpg'; 
              break; 
             case "image/gif": 
              $uploadfile .= '.gif'; 
              $mfilename .= '.gif'; 
              break; 
             case "video/m4v": 
              $uploadfile .= '.gif'; 
              $mfilename .= '.gif'; 
              break; 
             case "image/png": 
              $uploadfile .= '.png'; 
              $mfilename .= '.png'; 
              break; 
            } 
           } 
           else 
           { 
            $errored = 1; 
            $txterror = $this->lang('global_post_txterror3') . ': ' . $images_post['name'][$i]; 
            break; 
           } 
           $tmp_photos[] = $images_post['tmp_name'][$i]; 
           $photos[]  = $codep . '-' . $i . $extens; 
          } 
          if($errored == 0) 
          { 
           foreach($photos as $key => $fname) 
           { 
            move_uploaded_file($tmp_photos[$key], '../' . $C->FOLDER_PHOTOS . $fname); 
            $thumbnail = new SmartImage('../' . $C->FOLDER_PHOTOS . $fname, true); 
            $thumbnail->mycrop($C->widthPhotoThumbail, $C->widthPhotoThumbail, 'center'); 
            $thumbnail->saveImage('../' . $C->FOLDER_PHOTOS . 'min1/' . $fname); 
            $thumbnail->close(); 
           } 
           unset($mythumb); 
           $txttypeattach = 'photo'; 
          } 
          $endtxtatach = implode(',', $photos); 
         } 
        } 
        break; 
       case 2: 
        if(!empty($txtvalueatach)) 
        { 
         if(substr($txtvalueatach, 0, 20) == "https://youtube.com/" || substr($txtvalueatach, 0, 24) == "https://www.youtube.com/" || substr($txtvalueatach, 0, 16) == "www.youtube.com/" || substr($txtvalueatach, 0, 12) == "youtube.com/" || substr($txtvalueatach, 0, 19) == "http://youtube.com/" || substr($txtvalueatach, 0, 23) == "http://www.youtube.com/" || substr($txtvalueatach, 0, 16) == "http://youtu.be/") 
         { 
          parse_str(parse_url($txtvalueatach, PHP_URL_QUERY), $my_array_of_vars); 
          if(substr($txtvalueatach, 0, 16) == 'http://youtu.be/') 
          { 
           $endtxtatach = str_replace('http://youtu.be/', 'yt:', $txtvalueatach); 
          } 
          else 
          { 
           $endtxtatach = 'yt:' . $my_array_of_vars['v']; 
          } 
         } 
         elseif(substr($txtvalueatach, 0, 17) == "http://vimeo.com/" || substr($txtvalueatach, 0, 21) == "http://www.vimeo.com/" || substr($txtvalueatach, 0, 18) == "https://vimeo.com/" || substr($txtvalueatach, 0, 22) == "https://www.vimeo.com/" || substr($txtvalueatach, 0, 14) == "www.vimeo.com/" || substr($txtvalueatach, 0, 10) == "vimeo.com/") 
         { 
          $endtxtatach = 'vm:' . (int) substr(parse_url($txtvalueatach, PHP_URL_PATH), 1); 
         } 
         else 
         { 
          $errored = 1; 
          $txterror = $this->lang('global_post_txterror4'); 
         } 
         if(!empty($endtxtatach)) 
         { 
          $withattach = 1; 
          $typeattach = 2; 
          $txttypeattach = 'video'; 
         } 
        } 
        break; 
       case 3: 
        if(!empty($txtvalueatach)) 
        { 
         if(substr($txtvalueatach, 0, 23) == "https://soundcloud.com/" || substr($txtvalueatach, 0, 27) == "https://www.soundcloud.com/" || substr($txtvalueatach, 0, 22) == "http://soundcloud.com/" || substr($txtvalueatach, 0, 22) == "https://m.soundcloud.com/" || substr($txtvalueatach, 0, 22) == "http://soundcloud.com/" || substr($txtvalueatach, 0, 22) == "http://www.soundcloud.com/" || substr($txtvalueatach, 0, 15) == "soundcloud.com/" || substr($txtvalueatach, 0, 19) == "www.soundcloud.com/") 
         { 
          $endtxtatach = 'sc:' . parse_url($txtvalueatach, PHP_URL_PATH); 
         } 
         else 
          $endtxtatach = $this->db1->e(htmlspecialchars(trim(clearnl($txtvalueatach)))); 
         if(!empty($endtxtatach)) 
         { 
          $withattach = 1; 
          $typeattach = 3; 
          $txttypeattach = 'music'; 
         } 
        } 
        break; 
       case 4: 
        if(!empty($txtvalueatach)) 
        { 
         $endtxtatach = $this->db1->e(htmlspecialchars(trim(clearnl($txtvalueatach)))); 
         if(!empty($endtxtatach)) 
         { 
          $withattach = 1; 
          $typeattach = 4; 
          $txttypeattach = 'map'; 
         } 
        } 
        break; 
       case 5: 
        if(!empty($txtvalueatach)) 
        { 
         $endtxtatach = $this->db1->e(htmlspecialchars(trim(clearnl($txtvalueatach)))); 
         if(!empty($endtxtatach)) 
         { 
          $withattach = 1; 
          $typeattach = 5; 
          $txttypeattach = 'visited'; 
         } 
        } 
        break; 
       case 6: 
        if(!empty($txtvalueatach)) 
        { 
         $endtxtatach = $this->db1->e(htmlspecialchars(trim(clearnl($txtvalueatach)))); 
         if(!empty($endtxtatach)) 
         { 
          $withattach = 1; 
          $typeattach = 6; 
          $txttypeattach = 'food'; 
         } 
        } 
        break; 
       case 7: 
        if(!empty($txtvalueatach)) 
        { 
         $endtxtatach = $this->db1->e(htmlspecialchars(trim(clearnl($txtvalueatach)))); 
         if(!empty($endtxtatach)) 
         { 
          $withattach = 1; 
          $typeattach = 7; 
          $txttypeattach = 'movie'; 
         } 
        } 
        break; 
       case 8: 
        if(!empty($txtvalueatach)) 
        { 
         $endtxtatach = $this->db1->e(htmlspecialchars(trim(clearnl($txtvalueatach)))); 
         if(!empty($endtxtatach)) 
         { 
          $withattach = 1; 
          $typeattach = 8; 
          $txttypeattach = 'book'; 
         } 
        } 
        break; 
       case 9: 
        if(!empty($txtvalueatach)) 
        { 
         $endtxtatach = $this->db1->e(htmlspecialchars(trim(clearnl($txtvalueatach)))); 
         if(!empty($endtxtatach)) 
         { 
          $withattach = 1; 
          $typeattach = 9; 
          $txttypeattach = 'game'; 
         } 
        } 
        break; 
      } 
     } 
    } 
    if($errored == 0) 
    { 
     if(empty($txtstatus) && empty($endtxtatach)) 
     { 
      $errored = 1; 
      $txterror = $this->lang('global_post_txterror5'); 
     } 
     else 
     { 
      $idwall = $this->network->idwall($id_wall, $posted_in); 
      $r  = $this->db1->query("INSERT INTO posts SET code='" . $codep . "', iduser=" . $this->user->id . ", post='" . $txtstatus . "', typepost='" . $txttypeattach . "', posted_in=" . $posted_in . ", id_wall=" . $idwall . ",valueattach='" . $endtxtatach . "', who_see=" . $wsee . ", whendate='" . time() . "'"); 
      $idpost = $this->db1->insert_id(); 
      $this->db1->query('INSERT INTO activities SET iduser=' . $this->user->id . ', action=3, iditem=' . $idpost . ', typeitem=1, date="' . time() . '"'); 
      if($idwall != $this->user->id) 
      { 
       $this->db1->query("UPDATE users SET num_posts=num_posts+1 WHERE iduser=" . $this->user->id . " LIMIT 1"); 
       $this->db1->query("UPDATE users SET num_posts_inwall=num_posts_inwall+1 WHERE iduser=" . $idwall . " LIMIT 1"); 
      } 
      else 
      { 
       $this->db1->query("UPDATE users SET num_posts=num_posts+1, num_posts_inwall=num_posts_inwall+1 WHERE iduser=" . $this->user->id . " LIMIT 1"); 
      } 
      preg_match_all('~([#])([^\s#]+)~', str_replace(array('\r', '\n'), ' ', $txtstatus), $matchedHashtags); 
      if(!empty($matchedHashtags[0])) 
      { 
       foreach($matchedHashtags[0] as $match) 
       { 
        $hashtag = str_replace('#', '', $match); 
        $hashtag = $this->db1->e(($hashtag)); 
        $this->db1->query("INSERT INTO trends SET iduser=" . $this->user->id . ", trend='" . $hashtag . "', idpost=" . $idpost . ", whendate='" . time() . "'"); 
       } 
      } 
     } 
    } 
    if($errored == 1) 
    { 
     $message = '0: ' . $txterror; 
    } 
    else 
    { 
     $onepost  = $this->db2->fetch(' 
       SELECT DISTINCT idpost, posts.code as pcode, whendate, posted_in, id_wall, typepost, valueattach, numlikes, numcomments, post, who_see, username, firstname, lastname, avatar, users.iduser as uiduser, users.code as ucode, verified 
       FROM posts, users 
       WHERE 
       (users.iduser=posts.iduser) 
       AND idpost=' . $idpost . ' 
       LIMIT 1'); 
     $D->isaPage  = $D->isOnlyOne = $D->isaGroup = $D->isWithOther = 0; 
     if($onepost->posted_in == 0) 
     { 
      if($onepost->uiduser == $onepost->id_wall) 
      { 
       $D->isOnlyOne = 1; 
       $D->codeUser = $onepost->ucode; 
       $D->userName = $onepost->username; 
       $D->nameUser = (empty($onepost->firstname) || empty($onepost->lastname)) ? $onepost->username : ($onepost->firstname . ' ' . $onepost->lastname); 
       $D->userAvatar = $onepost->avatar; 
      } 
      if($onepost->uiduser != $onepost->id_wall) 
      { 
       $D->isWithOther = 1; 
       $D->codeUser  = $onepost->ucode; 
       $D->userName  = $onepost->username; 
       $D->nameUser  = (empty($onepost->firstname) || empty($onepost->lastname)) ? $onepost->username : ($onepost->firstname . ' ' . $onepost->lastname); 
       $D->userAvatar  = $onepost->avatar; 
       $wallsec   = $this->network->infoBasicWall($onepost->posted_in, $onepost->id_wall); 
       $D->other_code  = $wallsec->code; 
       $D->other_userName = $wallsec->username; 
       $D->other_nameUser = (empty($wallsec->firstname) || empty($wallsec->lastname)) ? $wallsec->username : ($wallsec->firstname . ' ' . $wallsec->lastname); 
      } 
     } 
     if($onepost->posted_in == 1) 
     { 
      $D->isaPage = 1; 
      $D->idPage = $onepost->id_wall; 
      $thePage  = $this->db2->fetch('SELECT code, url, avatar_page, title FROM pages WHERE idpage=' . $D->idPage . ' LIMIT 1'); 
      $D->pUserName = $thePage->url; 
      $D->pCode  = $thePage->code; 
      $D->pAvatar = $thePage->avatar_page; 
      $D->pTitle = stripslashes($thePage->title); 
     } 
     if($onepost->posted_in == 2) 
     { 
      $D->isaGroup = 1; 
     } 
     $D->a_date  = $onepost->whendate; 
     $D->codeUser = $onepost->ucode; 
     $D->valueattach = $onepost->valueattach; 
     $D->typepost = $onepost->typepost; 
     $D->idpost  = $onepost->idpost; 

     $D->codepost   = $onepost->pcode; 
     $D->idUser   = $onepost->uiduser; 
     $D->numlikes   = $onepost->numlikes; 
     $D->numcommentstotal = $onepost->numcomments; 
     $D->post    = stripslashes($onepost->post); 
     $D->whosee   = $onepost->who_see; 
     $D->post    = str_replace('&lt;script&gt;', '<script>', $D->post); 
     $D->post    = str_replace('&lt;/script&gt;', '<\/script>', $D->post); 

     $txtpostreturn = ''; 
     $txtpostreturn = $this->load_template('__one-post.php', FALSE); 
     unset($onePost); 
     $txtpostreturn = str_replace('<script>', '&lt;script&gt;', $txtpostreturn); 
     $txtpostreturn = str_replace('</script>', '&lt;/script&gt;', $txtpostreturn); 
     $message  = '1: ' . $txtpostreturn; 
    } 
} 
?> 
<script language="javascript" type="text/javascript"> 
    window.top.window.endPostear('<?php echo $this->db1->e($message); ?>'); 
</script> 
+0

정말 많은 코드를 읽을 수 있습니다. 짧은 것을 생산할 수 있다면 더 많은 피드백을 얻게 될 것입니다. – jh1711

+0

서식 코드 –

답변

0

의 상태로 응답 :

(406) 불가 클라이언트 오류 응답 코드는 것을 나타내는 HTTP 응답 일치 Accept-CharsetAccept-Language에 정의 된 허용 값 목록을 제공 할 수 없습니다.

일부 언어 파일을 사용하고있는 것처럼 보입니다. 그렇다면 문제가 될 수 있습니다. 서버 로그는 무엇을 말합니까?

+0

그것에 대해 error_log가 없습니다. – Nukaswitz

+0

POST 406 (허용되지 않음) @ 익명 @ 대시 보드 : 465 dispatch @ jquery.min.js : 5 y.handle @ jquery.min.js : 5 서버에서 응답. – Nukaswitz

+0

파일은 어떻게 게시됩니까? upoaded 파일의 content-type이 잘못 설정되었다고 생각합니다. – miknik

관련 문제