저는 비영리 단체가 비영리 단체에 무료 호스팅을 제공하는 호스트로 옮기기 위해 노력하고 있습니다. 내 웹 페이지 지식은 오래되었고 HTML에 거의 제한되어 있습니다. PHP 지식이 없습니다. 우리의 현재 호스트는 사용자를위한 사용자 인터페이스를 가지고 있으며 우리가 public_html 폴더에있는 파일을 보거나 다운로드하지 못하게합니다.index.php? s = 다른 콘텐츠를로드하지 않습니다.
기술 지원에 따르면 해당 플랫폼에서는 불가능합니다. 새로운 호스트 사이트에서 대부분의 콘텐츠를 재현 할 수 있었지만 index.php 파일을 다시 만들 수 없습니다. PHP 튜토리얼을 사용하여 새로운 튜토리얼을 만들었지 만 시작 페이지를 제외한 어떠한 콘텐트도로드하지 않으며 코드에서 내가 뭘 잘못했는지 확신 할 수 없습니다.
내 메뉴 항목은 다음과 같이 :
<li class="on">
<a href="http://ourcharity/index.php?s=8077" target="_self"class="on">Welcome</a>
</li>
내 index.php를 코드는 다음과 같습니다
<?php
// create an array with data for title, and meta, for each page
$pgdata = array();
$pgdata['8077'] = array(
'title'=>'WELCOME',
'description'=>'',
'keywords'=>'self-sufficiency'
);
$pgdata['8065'] = array(
'title'=>'About Us',
'description'=>'',
'keywords'=>'self-sufficiency'
);
// set the page name
$pgname = isset($_GET['pg']) ? trim(strip_tags($_GET['pg'])) : '8077';
// get title, and meta data for current /accessed page
$title = $pgdata[$pgname]['title'];
$description = $pgdata[$pgname]['description'];
$keywords = $pgdata[$pgname]['keywords'];
// set header for utf-8 encode
header('Content-type: text/html; charset=utf-8');
?>
<!doctype html>
<html>
<head>
<!-- begin spin_special_output(head_start) -->
<style type="text/css">
.wd_featurebox_icon {
display: inline;
}
.wd_featurebox_icon img {
vertical-align: middle;
}
div.wd_featurebox_group div.wd_tabs_wrapper {
border: none;
border-bottom: 1px solid #E1E1E1;
padding: 0 0 5px 0;
}
div.wd_featurebox_group div.wd_featurebox {
border: none;
padding: 8px 0 0 0;
}
div.wd_featurebox_group li.wd_tab {
float: none;
color: #666666;
}
div.wd_featurebox_group li.wd_tab-active {
border: none;
background-color: transparent;
color: #000000;
font-weight: bold;
}
div.wd_featurebox_group li.wd_tab-inactive {
cursor: auto;
}
</style>
<script type="text/javascript">
function view_printable() {
var loc = window.location;
var sep = (loc.search == "") ? "?" : "&";
var url = loc.protocol+"//"+loc.host+loc.pathname+loc.search+sep+"printable"+loc.hash;
window.open(url, "_blank", "");
}
</script>
<style type="text/css">
span.wd_page_tool {display: inline-block; margin: 0px; padding: 0px; vertical-align: middle;}
div.wd_page_toolbar td span.wd_page_tool {margin: 2px;}
div.wd_page_toolbar td {text-align: center;}
span.wd_page_tool a {display: inline-block; height: 16px; margin: 0px; padding: 0px; vertical-align: middle;}
span.wd_page_tool a span {display: inline-block; margin: 0px; padding: 0px; vertical-align: middle;}
</style>
<!-- end spin_special_output(head_start) -->
<meta charset="utf-8" />
<title><?php echo $title; ?></title>
<meta name="description" content="<?php echo $description; ?>" />
<meta name="keywords" content="<?php echo $keywords; ?>" />
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/wdcontent.css" />
<link rel="image_src" href="images/facebook_logo.jpg" />
</head>
<body>
<div id="headerwrapper" align="center">
<div id="header">
<div id="headerleft">
<div id="headerright">
<div id="logo"><img src="images/logo.jpg" alt="" border="0" /></div>
<div id="headerinner">
<div id="topnav">
<ul>
<li><a href="index.php?s=8088" target="_self">Contact Us</a></li>
</ul>
</div>
<div id="tagbanner">
<img src="file.php/70929/banner.jpg" border="0" />
<div id="tagline">
Self-Sufficiency
<h2></h2><p> </p> </div>
</div>
</div>
<div id="search" align="right">
<div id="searchform">
<!-- BEGIN T1 SEARCH -->
<form method="post" action="index.php?s=8092">
<input class="input" size="15" name="query" value="" />
<input type="submit" class="submit" value="Search" />
</form>
<!-- END T1 SEARCH -->
</div>
</div>
</div><!-- END HEADERRIGHT -->
</div><!-- END HEADERWRAPPERINNERLEFT -->
</div><!-- END HEADER -->
</div><!-- END HEADERWRAPPER -->
<?php echo file_get_contents(''. $pgname. '.htm'); ?>
</body>
</html>
'$ _GET [ 'pg']'대신'$ _GET [ 's']'를 사용하면 어떨까요? (2 번 줄 16 번) – MiniGod
그게 문제였습니다. 고마워요! 나는 그 코드를 여러 시간 동안 사용해 왔지만 그 상관 관계를 만들지 않았지만 지금은 완벽하게 이해하고 있습니다. – user3103472
데이터가 링크 내에 표시되도록하려면 GET 양식 유형 만 사용하십시오. – Anas