Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

PHP product catalog help

need some help creating a product catalog
website = http://cashzone.seitservices.com.au

currently have it set up as follows
index is setup using the following code
[code]<?php
$page = 'main.php';   // Default page
$pages = array('main', 'about','./products/products','contact','new');

// Check if p is set
if(isset($_GET['p'])) {

    // Check if the page in the url is in the defined array
    if(in_array($_GET['p'], $pages)) {
       
        $page = $_GET['p'].'.php';

    } else {

        $page = 'main.php';

    }

}
?>[/code]

products has its own folder
products.php is set up as follows
[code]<?php
$page = 'productsmain.php';   // Default page
$pages = array('productsmain', 'cards','collectables','dvds','electronics');

// Check if p is set
if(isset($_GET['p'])) {

    // Check if the page in the url is in the defined array
    if(in_array($_GET['p'], $pages)) {
       
        $page = $_GET['p'].'.php';

    } else {

        $page = 'productsmain.php';

    }

}
?>

<table border="0" width="750" height="100%">
      <tr>
            <td height="100%" width="150" valign="top"><?php include('productcatergory.php');?></td>
            <td height="100%" width="600" valign="top"><?php include($page);?></td>
      </tr>
</table>[/code]

productscatergory.php is set up as follows
[code]<a href="./products/products.php?p=cards"><b>Cards</a><br>
<a href="./products/products.php?p=collectables"><b>Collectables</a><br>
<a href="./products/products.php?p=dvds"><b>DVDs</a><br>
<a href="./products/products.php?p=electronics"><b>Electronics</a><br>[/code]

you ca see the results at http://cashzone.seitservices.com.au

obviously i do not want a new page open for the products except I would like them to stay within the original site. I would like it to load in the productsmain section.

If u require me to extend on my explanation please let me know
0
southeastit
Asked:
southeastit
  • 2
1 Solution
 
southeastitAuthor Commented:
Go to http://cashzone.seitservices.com.au
click on products
you will notice a list of product categorys on the left and the products main page on the right
when you click on one of the product catergorys on the left it opens up in the wrong manner
What I would like it to do is if you click on cards it will open up the cards for sale on the right replacing the products main page.

It currently does that but outside of the current layout
0
 
southeastitAuthor Commented:
fixed it by creating the products.php to be set up like the index

[code] <head>
<title>Cash Zone Products</title>
</head>
<body bgcolor="#000000" link="#000000" vlink="#000000" alink="#9F9F00">
<?php
$page = 'productsmain.php';   // Default page
$pages = array('productsmain', 'cards','collectables','dvds','electronics');

// Check if p is set
if(isset($_GET['d'])) {

    // Check if the page in the url is in the defined array
    if(in_array($_GET['d'], $pages)) {
       
        $page = $_GET['d'].'.php';

    } else {

        $page = 'productsmain.php';

    }

}
?>

<center><table border="0" width="810" height="800" cellspacing="0" cellpadding="0" bgcolor="#FFFF99">
   <tr>
      <td height="100" width="810" bgcolor="#000000" colspan="4"><?php include('../heading.php');?> </td>
   </tr>
   <tr>
      <td height="30" width="30" valign="top" background="../images/corner.png"> </td>
      <td height="30" width="750" valign="top" background="../images/links.png" colspan="2"><?php include('../topmenu.php');?></td>
      <td height="30" width="30" valign="top" background="../images/corner.png">&nbsp;</td>
   </tr>
   <tr>
      <td height="100%" width="30" valign="top" background="../images/border.png"> </td>
      <td height="100%" width="150" valign="top"><?php include('../products/productcatergory.php');?></td>
      <td height="100%" width="600" valign="top"><?php include($page);?></td>
      <td height="100%" width="30" valign="top" background="../images/border.png"></td>
   </tr>
   <tr>
      <td height="30" width="30" background="../images/corner.png"> </td>
      <td height="30" width="750" background="../images/links.png" colspan="2"><?php include('../bottom.php');?></td>
      <td height="30" width="30" background="../images/corner.png">&nbsp;</td>
   </tr>
</table>
[/code]

for refrence
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now