Предупреждение PHP [function.include]: не удалось открыть поток - PullRequest
0 голосов
/ 29 июля 2011

http://smiths -heimann.az / index.php? Feat = 1 пожалуйста, проверьте эту страницу. Мой PHP-код выглядит так.

<?php 
/*at the top of the page*/
if (!isset($feat)){
if (isset($_GET['page'])) 
{
    $page=$_GET['page'];
    }   
if (!isset($_GET['page']) && !isset($_GET['feat'])) 
{
    $page=1;
    }       
${'page'.$page}='class="current"';
}
    if (isset($_GET['feat']) && !isset($_GET['page']))
    {
    $feat=$_GET['feat'];
    }
....
/*content*/

        if(isset($page) && isset($_GET['id']) && !isset($_GET['subid']))
        include "core/content/pages/".$page.$_GET['id'].".php";
        if(isset($page) && isset($_GET['id']) && isset($_GET['subid']))
        include "core/content/pages/".$page.$_GET['id'].$_GET['subid'].".php";
        if(isset($page) && !isset($_GET['id']) && !isset($_GET['subid'])) 
        include "core/content/pages/".$page.".php";  /*line 136*/
        if (isset($feat) && !isset($_GET['page']))
    {
    $feat=$_GET['feat'];
    include "core/content/pages/featured.php";
        } 
        ?>

В чем проблема? Пожалуйста, помогите

Ответы [ 4 ]

1 голос
/ 29 июля 2011

Если вы посмотрели в своем предупреждении, то там написано, что не удалось найти

Warning: include(core/content/pages/class="current".php) [function.include]: failed to open stream: No such file or directory in /home/heimann/public_html/index.php on line 136

страница ..

Я уверен, что нет такой страницы, как class = "current" .php ....

маленькая ошибка .. Я уверен, что вы можете легко устранить ее

ошибка лежит на

${'page'.$page}='class="current"';

линия

0 голосов
/ 29 июля 2011

Я решил это

Заменены

/*at the top of the page*/
if (!isset($feat)){
if (isset($_GET['page'])) 
{
    $page=$_GET['page'];
    }   
if (!isset($_GET['page']) && !isset($_GET['feat'])) 
{
    $page=1;
    }       
${'page'.$page}='class="current"';
}
    if (isset($_GET['feat']) && !isset($_GET['page']))
    {
    $feat=$_GET['feat'];
    }

с

if (!isset($feat)){
if (isset($_GET['page'])) 
{
    $page=$_GET['page'];
    ${'page'.$page}='class="current"';
    }   
if (!isset($_GET['page']) && !isset($_GET['feat'])) 
{
    $page=1;
    ${'page'.$page}='class="current"';
    }       

}
    if (isset($_GET['feat']) && !isset($_GET['page']))
    {
    $feat=$_GET['feat'];
    }
0 голосов
/ 29 июля 2011

Прочитайте остальную часть ошибки на вашем сайте:

No such file or directory

Путь или имя файла неверны.Похоже, проблема в этой строке:

${'page'.$page}='class="current"';
0 голосов
/ 29 июля 2011

ЗАМЕНА

        if(isset($page) && isset($_GET['id']) && !isset($_GET['subid']))
        include "core/content/pages/".$page.$_GET['id'].".php";
        if(isset($page) && isset($_GET['id']) && isset($_GET['subid']))
        include "core/content/pages/".$page.$_GET['id'].$_GET['subid'].".php";
        if(isset($page) && !isset($_GET['id']) && !isset($_GET['subid'])) 
        include "core/content/pages/".$page.".php";  /*line 136*/

С

        if(isset($page) && isset($_GET['id']) && !isset($_GET['subid']))
        @include "core/content/pages/".$page.$_GET['id'].".php";
        if(isset($page) && isset($_GET['id']) && isset($_GET['subid']))
        @include "core/content/pages/".$page.$_GET['id'].$_GET['subid'].".php";
        if(isset($page) && !isset($_GET['id']) && !isset($_GET['subid'])) 
        @include "core/content/pages/".$page.".php";  /*line 136*/

ПРИМЕЧАНИЕ

Когда 'isset ($ _ GET [' id '])' 'true ... Вы должны убедиться, что $ page установлен правильно

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...