Announcement:Materials and articles for ProductCart 5 can be found at our brand new support center.

Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!

Creating custom pages that use header.asp and footer.asp

Basic code

Let's say you wanted to create a page that does not rely on ProductCart' Content Pages feature, but still uses the same store interface defined by header.asp, footer.asp, and related files. How can you accomplish this? It's actually quite easy.

  • Create a blank, ASP page in your favorite HTML editor
  • Save it in the “pc” folder of your store (create a local directory structure on your desktop that mimics your online store)
  • Open the file and paste the following code in it
    <% response.Buffer=true %>
    <!--#include file="../includes/settings.asp"-->
    <!--#include file="../includes/storeconstants.asp"--> 
    <!--#include file="../includes/opendb.asp"-->
    <!--#include file="../includes/languages.asp"-->
    <!--#include file="../includes/currencyformatinc.asp"-->
    <!--#include file="../includes/stringfunctions.asp"-->
    <!--#include file="pcStartSession.asp"-->
    <!--#include file="header.asp"-->
    	<div id="pcMain">
    
    	</div>
    <!--#include file="footer.asp"-->

  • Add to the page any HTML code you wish within the “pcMain” DIV
  • Save the page with whichever name you wish to use for it (e.g. MyNewPage.asp) and upload it to the “pc” folder on your Web server.

Querying the store database

If you need to query the store database, use code that is structured as follows (here the query is just a simple placeholder for what your query will look like, of course).

<div id="pcMain">
<%
Dim rs, connTemp, query
call opendb()
	query="SELECT * FROM Customers;"
	set rs=server.CreateObject("ADODB.RecordSet")
	set rs=connTemp.execute(query)
	set rs=nothing
call closedb()
%>
</div>

QR Code
QR Code Creating custom pages that use header.asp and footer.asp (generated for current page)