quick shopping cart question - how many web pages ?
don't want use existing shopping cart - i've written shopping cart in 2003 , need quick refresher i'm rusty , haven't use coldfusion since then...
background:
website sell following types of jewellery categories:
rings
bracelets
pendants
necklaces
rather create web page each category eg.
rings.cfm
bracelets.cfm
pendants.cfm
necklaces.cfm
is better create single web page, products.cfm, encompasses above? maintenance purposes (eg. adding additional categories in future) seem logical approach ?
digging deeper workings of single webpage, products.cfm, when user clicks on 'rings' category, products.cfm reloaded appropriate url eg.
products.cfm?category=rings
the webpage, products.cfm, contain coldfusion logic picks url , adjusts sql query fetches items fall 'rings' category eg.
select *
from products
where category = rings
am on right track ?
your on right track.
don't use select * general rule of thumb, beyond simple demo code.
select * products category = <cfqueryparam value="#url.category#" cfsqltype="...">
but, coldfusion makes pretty easy have cake , eat to.
if urls like:
rings.cfm
bracelets.cfm
pandants.cfm
necklaces.cfm
which can search engine optimization.
i have done these 2 line files before:
rings.cfm
------------
<cfset variables.category = rings>
<cfinclude template="products.cfm">
and products.cfm file works same above, except use variables.catgory instead url.category. pretty easy use cfml <cfile....> tag create or remove these 2 line files when categories added or removed.
More discussions in Getting Started
adobe
Comments
Post a Comment