Using Database to Fill in META TAGS

T

Thomas A. Rowe

Along as each record has a unique ID, then all you need to pass to the query is the ID

http://www.netterweb.com/search/fllartclvw.asp?ID=<%=FP_FieldURL(fp_rs,"ID")%>

Then on the page

in your query:

"SELECT ArticleTitle, Author, Description, Keywords FROM databasetable WHERE ID = " &
Request.QueryString("ID")"

To display:

<title><%=fp_rs("articletitle")%> by <%=fp_rs("author")%></title>
<meta name="description" content="<%=fp_rs("description")%>">
<meta name="keywords" content="<%=fp_rs("keywords")%>">
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
M

magmike

Currently, because I can figure no other way to do it, I am including the
keywords field and description field in the perameters of the link like so:

http://www.netterweb.com/search/fllartclvw.asp?ArticleTitle=<%=FP_FieldURL(fp_rs,"ArticleTitle")%>&Author=<%=FP_FieldURL(fp_rs,"Author")%>&ID=<%=FP_FieldURL(fp_rs,"ID")%>

So that the values are submitted to the page, and then requesting them in
the META Tags like so:

<title><%=Request("articletitle")%> by <%=Request("author")%></title>
<meta name="description" content="<%=Request("description")%>">
<meta name="keywords" content="<%=Request("keywords")%>">

to personalize the page for search engines and for the title purposes. Is
there a way that I can request the database for the header just using the ID
field so I can just send one perameter (that being the record id) with the
link?

Thanks
 
M

magmike

"SELECT ArticleTitle, Author, Description, Keywords FROM databasetable
WHERE ID = " &
Request.QueryString("ID")"

Where on the page should I put the SELECT statement?

I usually do my databasing through the FrontPage Database Results Wizard,
which I am certain has this statement in there somewhere. However, using the
request statements in the META TAGS come up blank in the final results.
ALSO, between what tags would I place the SELECT statement (i.e. <tag>
</tag>)?

Thanks!

PS: You can see an example of what I am currently doing here:

http://www.netterweb.com/search/fll...ginning.+Hints+on+starting+out+the+right+way.

but would prefer it to simple be this:

http://www.netterweb.com/search/fllartclvw.asp?ID=9091

However, you'll notice that when you visit this same page, and same record,
that the title is absent the information and the META TAGS absent the
information.

Thanks for your help,

mamgike
 
S

Stefan B Rusynko

You need to hand code the ASP and DB connection
Start by looking here
http://www.asp101.com/samples/




| > "SELECT ArticleTitle, Author, Description, Keywords FROM databasetable
| WHERE ID = " &
| > Request.QueryString("ID")"
|
| Where on the page should I put the SELECT statement?
|
| I usually do my databasing through the FrontPage Database Results Wizard,
| which I am certain has this statement in there somewhere. However, using the
| request statements in the META TAGS come up blank in the final results.
| ALSO, between what tags would I place the SELECT statement (i.e. <tag>
| </tag>)?
|
| Thanks!
|
| PS: You can see an example of what I am currently doing here:
|
|
http://www.netterweb.com/search/fll...ginning.+Hints+on+starting+out+the+right+way.
|
| but would prefer it to simple be this:
|
| http://www.netterweb.com/search/fllartclvw.asp?ID=9091
|
| However, you'll notice that when you visit this same page, and same record,
| that the title is absent the information and the META TAGS absent the
| information.
|
| Thanks for your help,
|
| mamgike
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top