Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This isnt really an answer but i felt compelled to post here because of what i feel is a poor app design situation</p> <p>From the comment thread on the main question:</p> <blockquote> <p>sorry to make you confuse but they is nothing to be really confuse about. For an example the cap, shoe uses the product.php page and the gloves, shirts uses the itemview.php pages both pages uses the product ID (ID) when you click on view. Hope that makes sense</p> </blockquote> <p>It still doesnt make sense. All of these things you mention are in fact products... jsut different type of products. In any sane design they will all use the same URL format. The logic to do things based on the type of product belongs in whatever you are using as a controller - in your case i assume the .php page in the url. You need only one of these... From there you can do different things. </p> <p>Example in the most basic sense:</p> <pre><code>// This is product.php if(!isset($_GET['id'])) { // 404 or some other error } $product = get_item_by_id($_GET['id']); if(!$product) { // 404 or other error } switch($product['type']) { case 'cap': case 'shoes': // for cap and shoes use the product_view template include 'product_view.php'; break; case 'gloves': case 'shirts': // for gloves and shirts use the item_view template include 'item_view.php'; break; default: // otherwise use the default product view template include 'default_view.php'; } // anything else you need to do that isnt done in the view specific file </code></pre> <p>Now that all assumes these are specific products, but your examples sound more like categories. Normally you would have a separate page for categories that did much the same thing as the product but outputted a "collection" of product entities in some visual fashion.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload