繁体   English   中英

php包含的网页链接返回到首页

[英]Links to web pages that are php includes goes back to home page

我不认为自己擅长php,所以那些高手请不要因为我的菜鸟方法而对我ash之以鼻。 我在尝试学习。

不久以前,我有个人向我展示如何分解部分网页并将其编写为包括在内,这样我就不会为每个页面设置页眉,页脚和导航重绘。 截至昨天早上,我的页面加载良好,并且已经使用了很多年。 但是,可能在我的服务器上出了点问题,现在所有页面都转到主页。

我的页面设置如下:

的index.php

<?php 


if (! isset($HTTP_GET_VARS['content']) || ! $HTTP_GET_VARS['content']){
  $content="squeeze";
}
else 
  $content=$HTTP_GET_VARS['content'];

//1
if ($content == "do-you-have-success-habits"){
    $page_title="Do You Have Success Habits?";
    $keywords="Booking Agent Book, Music Business Career Development Information, Performing Arts Entertainment Information";
    $desc="Music Business Booking Management artist career development for musicians, performing artists, agents and managers";
    $style="../scripts/style.css";
    $popupjs="none";
    $storbutnjs="none";
    $retreatjs="none";
    $rolloverjs="none";
    $readform_chkjs="none";
    $logo="req-files/logo.html";
    $navbar="req-files/navbar.html";
    $sidebar="req-files/sidebar.html";
    $main="weekly/2013/do-you-have-success-habits.html";
}
include ("req-files/head.html");
include ($logo);
include ($navbar);
include ($sidebar);
include ($main);
include ("req-files/footer.html");

?>

这是我所拥有的精简版。 整个index.php的所有页面都是这样编写的,但也包含其他php页面的内容。 这个网站的内容太多,以至于我不得不在一个页面内用类似的信息来构建php页面... IE,所有会员都将进入affiliates.php,然后将其包含在我的index.php中。

// INCLUDE AFFILIATES HERE
include ("affiliates.php");

我希望这是足够的信息来帮助我解决问题。

我的作品的样本类似于此头文件。 我的变量是零散的。

head.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title><?php print $page_title ?></title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="author" content=" " />
    <meta name="keywords" content="<?php print $keywords ?>" />
    <meta name="description" content="<?php print $desc ?>" />
    <meta name="copyright" content="2006-2013" />
    <link rel="stylesheet" type="text/css" href="<?php print $style ?>" />
    <link href="scripts/twoColLiqLtHdr.css" rel="stylesheet" type="text/css" /><!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColLiqLtHdr #sidebar1 { padding-top: 30px; }
.twoColLiqLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
    <link rel="stylesheet" type="text/css" href="scripts/style.css" />
    <script src="scripts/stuHover.js" type="text/javascript"></script>
    <link href="scripts/dropdown_menu.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="/favicon.png" />

    <?php
    if ($popupjs != "none") {
        print("<script src=\"${popupjs}\">");
        print("</script>\n");
    }
    if ($storbutnjs != "none") {
        print("     <script src=\"${storbutnjs}\">");
        print("</script>\n");
    }
    if ($retreatjs != "none") {
        print("     <script src=\"${retreatjs}\">");
        print("</script>\n");
    }
    if ($rolloverjs != "none") {
        print("     <script src=\"${rolloverjs}\">");
        print("</script>\n");
    }
    if ($readform_chkjs != "none") {
        print("     <script src=\"${readform_chkjs}\">");
        print("</script>\n");
    }
    ?>

</head>

如前所述,我对php没有经验。 因此,我无法理解为什么导航中链接的页面要转到主页(挤压)页面。

现在,我的托管技术支持人员指出,可能由于过时的代码而导致失败。 他们正在将我的网站迁移到php的早期版本。 但是我需要知道从哪里开始解决此问题。 我希望这是一个简单的解决方法,因为该站点很大!

感谢您的耐心配合和帮助。

海蒂

@DrCord:

在我给出的这个特定示例中,有两个导航系统。 我将侧边栏称为其他菜单。 两者都设置为部分html页面。

menu.html

<tr>
<td align="center"><img src="images/design_elements/yellow_spacer.gif" alt="Yellow line" width="745" height="2" border="0" /></td>
</tr>
<tr>
<td align="center" valign="middle" background="images/design_elements/navbar.jpg" width="760" height="42" class="menubar"><nobr><a href="?content=about" title="About" style="text-decoration: none;">About</a></nobr>&nbsp;|&nbsp;<nobr><a href="?content=articles" title="Articles" style="text-decoration: none;">Articles</a></nobr>&nbsp;|&nbsp;<nobr><a href="?content=consult" title="Consulting" style="text-decoration: none;">Consulting</a></nobr>&nbsp;|&nbsp;<nobr><a href="?content=store" title="Booking Tools" style="text-decoration: none;">Booking Tools</a></nobr>&nbsp;|&nbsp;<nobr><a href="?content=seminars" title="Seminars" style="text-decoration: none;">Seminars</a></nobr>&nbsp;|&nbsp;<nobr><a href="?content=teleseminars" title="Teleseminars" style="text-decoration: none;">Teleseminars</a></nobr>&nbsp;|&nbsp;<nobr><a href="?content=contact" title="Contact" style="text-decoration: none;">Contact</a></nobr>&nbsp;|&nbsp;<nobr><a href="?content=media" title="Media EPK" style="text-decoration: none;">Media EPK</a></nobr>&nbsp;|&nbsp;<nobr><a href="?content=resources" title="Links" style="text-decoration: none;">Links</a></nobr></td>
</tr>
<tr>
<td align="center"><img src="images/design_elements/yellow_spacer.gif" alt="Yellow line" width="745" height="2" border="0" /></td>
</tr>
<tr>
<td><img src="images/design_elements/spacer.gif" alt="spacer" width="1" height="10" border="0" /></td>
</tr>
</table>

sidebar.html

<div id="container2">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="images/design_elements/lt-side-shadow.jpg" width="40"><img src="images/design_elements/lt-side-shadow.jpg" border="0" width="40" height="10" alt="Design Element" /></td>
<td valign="top">

<div id="sidebar1">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" style="padding: 10px;">
<table width="90%" border="0" cellpadding="0" cellspacing="0" id="cont">
<tr>
<td class="head"><a href="?content=articles">Articles</a></td>
</tr>
<tr>
<td class="head">Biz Coaching</td>
</tr>
<tr>
<td class="subhead" style="padding-left:10px;" nowrap="nowrap"><a href="?content=manager">Programs</a></td>
</tr>
<tr>
<td class="subhead" style="padding-left:10px;" nowrap="nowrap"><a href="?content=testimonials">Testimonials</a></td>
</tr>
<tr>
<td class="head">Books</td>
</tr>
<tr>
<td class="subhead" style="padding-left:10px; font-size:95%;" nowrap="nowrap"><a href="?content=HugeSuccess">Huge Success</a></td>
</tr>
<tr>
<td class="subhead" style="padding-left:10px;" nowrap="nowrap"><a href="?content=JerisBook">Guide to Touring</a></td>
</tr>
<tr>
<td class="subhead" style="padding-left:10px;" nowrap="nowrap"><a href="?content=store#ebook">E-Book</a></td>
</tr>
<tr>
<td class="subhead" style="padding-left:10px;" nowrap="nowrap"><a href="?content=recommends">I Recommend</a></td>
</tr>
</table>        

  <!-- end #sidebar1 --></div>

再次感谢您的耐心配合和帮助。 我知道我需要学习更多有关PHP的知识。 我只是不清楚这里的实际问题是什么。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM