I don't profess to be any good at php, so those who are expert please don't bash me for my noob approach. I am trying to learn.
Some time back, I had someone show me how to break up parts of my web pages and write them as includes so that I wasn't having headers, footers, and navigation repainting for every page. As of yesterday morning, my pages were loading fine, and have been for many years now. However, something seems to have gone wrong, possibly on my server, and now all pages go to home page.
I have my pages set up as such:
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");
?>
This is a chopped down version of what I have. The whole index.php has all pages written like this, but it also contains includes to other php pages. There is so much content to this site that I've had to build php pages with like informations within one page... I.E. all affiliates would go into affiliates.php and then included into my index.php as such.
// INCLUDE AFFILIATES HERE
include ("affiliates.php");
I'm hoping this is enough information to help me troubleshoot my problem.
A sample of my pieces are like this header file. My variables are in the pieces.
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>
As stated before, I am inexperienced with php. So, I'm having trouble understanding why my pages linked in my nav are going to home (squeeze) page.
Now, my hosting tech support states that it could be deprecated code that is causing this to fail. They are migrating my site, probably to a previous version of php. But I need to know where to begin fixing this. I hope it is a simple fix because this site is huge!
Thank you for your patience and your help.
Heidi
@DrCord:
On this particular example I gave, there are two nav systems. One I call sidebar the other menu. Both are set up as partial html pages.
menu.html
sidebar.html
Again, I thank you for your patience and your help. I know that I need to learn more about PHP, and I am. I am just not clear on what the actual problem is here.