Jump to content

Navigation Problem


Kookedoh

Recommended Posts

ok so made a simple shopping cart for a college assignment it has an admin section so admin can add new items to the data  base but im having a problem with navigation. for example once logged in and want to navigate to a specific locaiton i get 404'd.

example:

http://localhost/admin/order/

is the page once logged in but when i select a different link the url changes to

http://localhost/admin/order/admin/product/

instead of just

http://localhost//admin/product/

below is the code nay help would be hugly appreciated

<?php
if (!defined('WEB_ROOT')) {
exit;
}

$self = WEB_ROOT . 'admin/index.php';
?>
<html>
<head>
<title><?php echo $pageTitle; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="<?php echo WEB_ROOT;?>admin/include/admin.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="<?php echo WEB_ROOT;?>library/common.js"></script>
<?php
$n = count($script);
for ($i = 0; $i < $n; $i++) {
if ($script[$i] != '') {
	echo '<script language="JavaScript" type="text/javascript" src="' . WEB_ROOT. 'admin/library/' . $script[$i]. '"></script>';
}
}
?>
</head>
<body>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="1" class="graybox">
  <tr>
    <td colspan="2"><img src="<?php echo WEB_ROOT; ?>admin/include/banner-top.gif" width="750" height="75"></td>
  </tr>
  <tr>
    <td width="150" valign="top" class="navArea"><p> </p>
      <a href="<?php $_SERVER["HTTP_HOST"] ?>admin/" class="leftnav">Home</a> 
  <a href="<?php $_SERVER["HTTP_HOST"] ?>admin/category/" class="leftnav">Category</a>
  <a href="<?php $_SERVER["HTTP_HOST"] ?>admin/product/" class="leftnav">Product</a> 
  <a href="<?php $_SERVER["HTTP_HOST"] ?>admin/order/?status=Paid" class="leftnav">Order</a> 
  <a href="<?php $_SERVER["HTTP_HOST"] ?>admin/config/" class="leftnav">Shop Config</a> 
  <a href="<?php $_SERVER["HTTP_HOST"] ?>admin/user/" class="leftnav">User</a> 
  <a href="<?php echo $self; ?>?logout" class="leftnav">Logout</a>
      <p> </p>
      <p> </p>
      <p> </p>
      <p> </p></td>
    <td width="600" valign="top" class="contentArea"><table width="100%" border="0" cellspacing="0" cellpadding="20">
        <tr>
          <td>
<?php
require_once $content;	 
?>
          </td>
        </tr>
      </table></td>
  </tr>
</table>
<p> </p>

</body>
</html>

 

 

Link to comment
https://forums.phpfreaks.com/topic/178464-navigation-problem/
Share on other sites

Try this

<?php
if (!defined('WEB_ROOT')) {
   exit;
}

$self = WEB_ROOT . 'admin/index.php';
?>
<html>
<head>
<title><?php echo $pageTitle; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="<?php echo WEB_ROOT;?>admin/include/admin.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="<?php echo WEB_ROOT;?>library/common.js"></script>
<?php
$n = count($script);
for ($i = 0; $i < $n; $i++) {
   if ($script[$i] != '') {
      echo '<script language="JavaScript" type="text/javascript" src="' . WEB_ROOT. 'admin/library/' . $script[$i]. '"></script>';
   }
}
?>
</head>
<body>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="1" class="graybox">
  <tr>
    <td colspan="2"><img src="<?php echo WEB_ROOT; ?>admin/include/banner-top.gif" width="750" height="75"></td>
  </tr>
  <tr>
    <td width="150" valign="top" class="navArea"><p> </p>
      <a href="/admin/" class="leftnav">Home</a>
     <a href="/admin/category/" class="leftnav">Category</a>
     <a href="/admin/product/" class="leftnav">Product</a>
     <a href="/admin/order/?status=Paid" class="leftnav">Order</a>
     <a href="/admin/config/" class="leftnav">Shop Config</a>
     <a href="/admin/user/" class="leftnav">User</a>
     <a href="<?php echo $self; ?>?logout" class="leftnav">Logout</a>
      <p> </p>
      <p> </p>
      <p> </p>
      <p> </p></td>
    <td width="600" valign="top" class="contentArea"><table width="100%" border="0" cellspacing="0" cellpadding="20">
        <tr>
          <td>
<?php
require_once $content;    
?>
          </td>
        </tr>
      </table></td>
  </tr>
</table>
<p> </p>

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/178464-navigation-problem/#findComment-941137
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.