2013-07-16 3 views
0

아마도 이에 대한 분명한 답있다 그러나 나는 PHP의 세계 ..PHP 코드는

그래서 내가 UserCake 내 PHP 코드에서 $dbpages = fetchAllPagesD($path."/");을하고 페이지의 관련 경로를 보여주는 것에 새로운 해요 어떤 내용보다 먼저

전혀 표시하고 싶지 않습니다. 어떤 아이디어입니까? 나는이 같은에서 내 모든 코드를 삭제 싫어하지만 답을 찾는 데 도움이 될 것입니다

:

<?php 
/* 
UserCake Version: 2.0.2 
http://usercake.com 
*/ 
$root=str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']); 
require_once("models/config.php"); 
if (!securePage($_SERVER['PHP_SELF'])){die();} 
$path=""; 
if(isset($_GET['path'])) $path=$_GET['path']; 

$script=dirname($_SERVER['PHP_SELF']); 
$baspth=$path; 
$dir = glob($root.$path."/*" ,GLOB_ONLYDIR); 


$pages = getPageFiles($root.$path); //Retrieve list of pages in root usercake folder 
$dbpages = fetchAllPages(); //Retrieve list of pages in pages table 
$creations = array(); 
$deletions = array(); 

//Check if any pages exist which are not in DB 
if (count($pages) > 0) 
foreach ($pages as $page){ 
    if(!isset($dbpages[$page])){ 
     $creations[] = $page; 
    } 
} 

//Enter new pages in DB if found 
if (count($creations) > 0) { 
    createPages($creations) ; 
} 

if (count($dbpages) > 0){ 
    //Check if DB contains pages that don't exist 
    foreach ($dbpages as $page){ 
     if(!isset($pages[$page['page']])){ 
      $deletions[] = $page['id']; 
     } 
    } 
} 

//Delete pages from DB if not found 
if (count($deletions) > 0) { 
    deletePages($deletions); 
} 

//Update DB pages 
$dbpages = fetchAllPagesD($path."/"); 

?> 







<!DOCTYPE html> 
<head> 
    <!-- Page data --> 
    <title>ClarkeWing.com - My ClarkeWing.com ID - Administration</title> 
    <meta charset="UTF-8"> 
    <meta name="viewport" content="width=1020"> 
    <meta name="robots" content="noindex"> 
    <meta name="author" content="Hugo Clarke-Wing"> 

    <!-- Mapping --> 
    <link rel="home" href="http://www.clarkewing.com/"> 
    <link rel="index" href="http://www.clarkewing.com/sitemap/"> 

    <!-- CSS links --> 
    <link type="text/css" rel="stylesheet" href="/media/global/light_template/light_template.css" /> 
    <link type="text/css" rel="stylesheet" href="/media/global/nav/navigation.css" /> 
    <link type="text/css" rel="stylesheet" href="/media/global/footer/footer.css" /> 
    <link type="text/css" rel="stylesheet" href="/secure/models/css/admin_pages.css" /> 
    <link type="text/css" rel="stylesheet" href="/secure/models/css/secure-header.css" /> 
    <link type="text/css" rel="stylesheet" href="/media/global/fonts/MyriadPro-Regular.css" /> 

    <!-- JS links --> 
    <script type="text/javascript" src="/media/global/jquery.js"></script> 
    <script type="text/javascript" src="/media/global/placeholderfix.js"></script> 

    <!-- Analytics link --> 
    <script> 
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 

    ga('create', '***********', 'clarkewing.com'); 
    ga('send', 'pageview'); 
    </script> 
</head> 


<body> 

    <!-- HEADER --> 
    <nav id="globalheader" class="secure"> 
<?php 
$path_nav = $_SERVER['DOCUMENT_ROOT']; 
$path_nav .= "/media/global/nav/navigation.php"; 
include($path_nav); 
?> 
    </nav> 
    <!-- /HEADER --> 


    <!-- - - - - - - - - - - - - - - - - - - - - - - CONTENT - - - - - - - - - - - - - - - - - - - - - - - --> 
    <div id="main-wrapper"> 
     <div id="secure-header" class="admin"> 
<?php 
include("secure-header.php"); 
?> 
     </div> 

     <div class="content"> 
      <div id="results"> 
      <?php echo resultBlock($errors,$successes); ?> 
      </div> 

      <div id="directories"> 
       <h2>Directories</h2> 
       <?php 
       //echo"<br>realpth:".$realpth." baspth:".$baspth." dirname (baspth):".dirname($baspth)."<br>"; 
       ?> 
       <ul> 
        <?php 
        if($path!="/") 
        { 
         $top=dirname($baspth); 
         if($top=="\\")$top=""; 
         echo "<li><a href='".$_SERVER['PHP_SELF']."?path=".$top."'>../</a></li>"; 
        } 
        if (count($dir) > 0) 
        foreach ($dir as $directory){ 
        $directory =str_replace($root,'',$directory); 
         echo "<li><a href='".$_SERVER['PHP_SELF']."?path=".$directory."'>".basename($directory)."</a></li>"; 
        } 
        ?> 
       </ul> 
      </div> 

      <div id="pages"> 
       <?php 
       echo " 
       <h2>Current Directory: ".$baspth."/</h2>"; 
       ?> 
       <table> 
        <thead> 
         <tr> 
          <th>ID</th> 
          <th>Page</th> 
          <th>Access</th> 
         </tr> 
        </thead> 
        <tbody> 
         <?php 
         //Display list of pages 
         if (count($dbpages) > 0) 
         foreach ($dbpages as $page){ 
          echo " 
          <tr> 
          <td> 
          ".$page['id']." 
          </td> 
          <td> 
          <a href ='admin_page.php?id=".$page['id']."'>".basename($page['page'])."</a> 
          </td> 
          <td>"; 
          //Show public/private setting of page 
          if($page['private'] == 0){ 
           echo "Public"; 
          } 
          else { 
           echo "Private"; 
          } 
          echo " 
          </td> 
          </tr>"; 
         } 
         else echo " 
          <tr> 
           <td>&nbsp;</td> 
           <td>No PHP pages in this directory</td> 
           <td></td> 
          </tr>"; 
         ?> 
        </tbody> 
       </table> 
      </div> 
     </div> 
    </div> 
    <!-- - - - - - - - - - - - - - - - - - - - - - - /CONTENT - - - - - - - - - - - - - - - - - - - - - - - --> 


    <!-- FOOTER --> 
<?php 
$path_footer = $_SERVER['DOCUMENT_ROOT']; 
$path_footer .= "/media/global/footer/footer.php"; 
include($path_footer); 
?> 
    <!-- /FOOTER --> 

</body> 
</html> 
+0

웹 브라우저에서 페이지를 볼 때 PHP 코드 자체가 표시되는 것이 아니라 PHP 코드의 결과가 표시된다는 것을 의미합니까? 그렇다면 웹 서버가 PHP 코드를 해석하지 않습니다. 이것은 PHP가 제대로 설치되지 않았다는 것을 의미합니다. – David

답변

1

경로 등

포함에서, 함수 호출에서 어디서나 인쇄 할 수 있습니다 자신의 코드를 디버그하고 인쇄 된 부분을 찾고 코드의 일부를 삭제하고 페이지를 다시로드해야만 더 이상 표시되지 않을 때까지 코드를 인쇄하는 코드를 알 수 있습니다.

모든 기능 및 포함을 포함하여 전체 코드에 액세스 할 수 없다면 찾을 수 없지만이 문제는 실제로 필요하지 않습니다. 코드를 디버깅하는 방법 만 배우면됩니다.

+0

줄 자체가 표시되지 않고 단순히 경로. 도움이 될만한 질문이 있다면 전체 페이지 코드를 추가했습니다 ... – clarkewingh

+0

뭔가를 인쇄 할 수있는 내용이 많이 있습니다. 함수가 될 수도 있고 포함 할 수도 있습니다. 우리는 그것을 찾을 수 없습니다. 라인을 인쇄 할 곳을 찾을 때까지 코드를 디버깅하십시오. –