I am new at PHP and I am in charge of up moving and updating our web site. I can across some PHP that is now working right and would appreciate any help. The first piece of coding is suppose to load the name of PHP file into the variable $page. The next piece of coding is suppose to open that file to load the screen that was selected.
[php]<?php
$page = $_GET[‘page’];
$contactName = $_GET[‘contactName’];
$contactName = str_replace("-"," ",$contactName);
if ($page == “”) {
$page = “index”;
}
else if ($page == “contact”) {
$hideContact = true;
}
//Determines which link is active and apply an appropriate class identifier
function chkPage($whichPage) {
global $page;
global $linkActive;
if ($whichPage == $page) {
if ($whichPage == “employees”||$whichPage == “legal”){
return “active”;
}
else
{
return " class=“active”";
}
}
}
$topLinks = “<li” . chkPage("") . “><a href=”/">Home Page\n";
$topLinks .= “<li” . chkPage(“pipeline”) . “><a href=”/pipeline/">Pipeline Services\n";
$topLinks .= “<li” . chkPage(“oilfield”) . “><a href=”/oilfield/">Oilfield Services\n";
$topLinks .= “<li” . chkPage(“safety”) . “><a href=”/safety/">Safety & HR\n";
$topLinks .= “<li” . chkPage(“sales”) . “><a href=”/sales/">Sales & Marketing\n";
$topLinks .= “<li” . chkPage(“contact”) . “><a href=”/contact/">Contact Us\n";
$topLinks .= “<li class=“last " . chkPage(“employees”) . “”><a href=”/employees/”>Employees Area\n";[/php]
Main screen for web site
[php]
Welcome to Duphil, Inc. <?php include("includes/vars.php"); ?> <?php include("includes/top.php"); include("includes/pages/" . $page . ".php"); include("includes/bottom.php"); ?> [/php]