View Single Post
  #5 (permalink)  
Old 03-17-2008, 08:56 PM
imvain2 imvain2 is offline
WebProWorld Veteran
 
Join Date: Apr 2004
Posts: 349
imvain2 RepRank 1
Default Re: Dynamic Pages, Keywords Tools, SEO companies

I have actually created a process for my asp websites that generate "dynamic static" pages.

I prefer to make them my way instead of letting other programs do it for me. I have more control over the end product.

If you have access to do the database and know programming you could use my code as an example. Just loop through the product table and create new pages.

Also, even though each page is querystring free they are still dynamic.

Each page includes the header for the layout, which allows me to pass the title tag and meta description. Then there is an include file which displays the content of the page based a variable preset with the product/category's id.

Code:
Function CreateFileName(string)
	dim regExp, match, i, spec
	Filename = ""
	For i = 1 to Len( string )
		spec = Mid(string, i, 1)
		Set regExp = New RegExp
		regExp.Global = True
		regExp.IgnoreCase = True
		regExp.Pattern = "[A-Z]|[a-z]|[_]|[0-9]|[.]"
		set match = regExp.Execute(spec)
		If match.count = 0 then
			if spec = " " then
				Filename = Filename & "_"
			end if
		else
			Filename = Filename & spec
		End If
		Set regExp = Nothing
	Next
	CreateFileName = filename & "_for_sale.asp"
End Function

	function CreatePage(Category_ID,Category)
		NewFileName = CreateFileName(Category)
		PageBody = "<!--" & blank & "#include file=""header.inc""-->" & vbcrlf
		PageBody = PageBody & "<%" & vbcrlf
		PageBody = PageBody & vbtab & "Category_ID = " & Category_ID & vbcrlf
		PageBody = PageBody & "%"&blank&">" & vbcrlf
		PageBody = PageBody & "<!--" & blank & "#include file=""productslist.inc""-->" & vbcrlf
		PageBody = PageBody & "<" & blank & "!--#include file=""footer.inc""-->"
		Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
		strCountFileName = server.mappath("../") &"\" & NewFileName
		Set objCountFile = objFSO.CreateTextFile(strCountFileName, true)
		objCountFile.Write PageBody
		objCountFile.Close
		Set objCountFile = Nothing
		Set objFSO = Nothing
		CreatePage = NewFileName
end function
Reply With Quote