Link to home
Start Free TrialLog in
Avatar of southeastit
southeastit

asked on

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
Avatar of southeastit
southeastit

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of southeastit
southeastit

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial