2017-11-06 9 views
0

今日このエラーを見ましたが、昨日はすべて良かったです。 ホスティングベースの問題か、ローカルホスト上のファイルをいつでもうまく動かして正しく動作するかどうかわかりません。おそらく、安全なホスティングに問題がありますか? 誰かがヒントを持っているなら、私はとても感謝しています。リソース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

エラーログはありません。 – Nukaswitz

+0

POST 406(受け入れられない)(匿名)@ダッシュボード:465ディスパッチ@ jquery.min.js:5 y.handle @ jquery.min.js:5サーバーからの応答。 – Nukaswitz

+0

ファイルはどのようにPOSTされていますか?私は、アップロードされたファイルのコンテンツタイプが間違って設定されていると思います。 – miknik

関連する問題