I want to draw out records from the database, and use them in my meta tags. I only want to use one record, which is called "TITLE", and i want to use this in the "title", "keywords", and "description", in other word the content of all 3 is "TITLE"
I have page called "view.asp" whose relevant code is as below. The meta tags are in "inc.header.asp" file. - <!--#include file="inc_header.asp"-->
-
-
<% Dim SQL, RS, ID, TITLE, CONTENT, SUMMARY, POSTED, ALLOW_C, ALLOW_V, UPDATED, MESSAGE, VOTED, ALLOW_V_MAIN, _
-
ALLOW_C_MAIN, NID, AUTHOR, CATEGORIES, AID, USE_VIEW, NIMAGE
-
Dim CCOUNT, C_ID, C_NAME, C_EMAIL, C_COMMENT, C_DATE, C_SUBJECT, C_M_ID, C_ALLOW_E, C_CITY, C_COUNTRY, _
-
RCOUNT, RID, RTITLE, ACOUNT
-
-
-
NID = Trim(Request.QueryString("ID"))
-
VOTED = Trim(Request.Cookies("NEWS_ARTICLE_" & NID))
-
MEMBER_ID = Trim(Session("PMMS_ID"))
-
IF Trim(Session("PMMS_IN")) = "True" THEN blLOGGED_IN = True
-
-
IF IS_VALID_ID(NID) THEN
-
-
Call OPEN_DB()
-
-
SQL = "SELECT fldA_V, fldA_C FROM nm_tbl_settings WHERE ID = 1"
-
Set RS = Server.CreateObject("ADODB.Recordset")
-
RS.LockType = 1
-
RS.CursorType = 0
-
RS.Open SQL, MyConn
-
IF NOT RS.EOF THEN
-
ALLOW_V_MAIN = trim(RS("fldA_V"))
-
ALLOW_C_MAIN = trim(RS("fldA_C"))
-
END IF
-
RS.Close
-
-
SQL = "UPDATE nm_tbl_news SET fldVIEWS = fldVIEWS + 1 WHERE ID = " & NID
-
MyConn.Execute(SQL)
-
-
SQL = "SELECT fldTITLE, fldCONTENT, fldSUMMARY, nm_tbl_news.fldACTIVE AS ACTIVE, fldAID, fldPOSTED, fldEXPIRES, nm_tbl_news.fldIMAGE AS NIMAGE, fldALLOW_COMMENTS, fldALLOW_VOTING, fldCREATED, fldUPDATE, nm_tbl_agent.fldNAME AS ANAME, nm_tbl_news.fldAID AS AID, fldUSE_VIEW FROM nm_tbl_news, nm_tbl_agent WHERE (nm_tbl_agent.ID = nm_tbl_news.fldAID) AND (nm_tbl_news.fldACTIVE = 1) AND nm_tbl_news.ID = " & NID ' { AND (Now() - {GetDate()} BETWEEN fldPOSTED AND fldEXPIRES)) }
-
response.write vbNewLine & "<!-- SQL: " & SQL & " -->" & vbNewLine
-
Set RS = Server.CreateObject("ADODB.Recordset")
-
RS.LockType = 1
-
RS.CursorType = 0
-
RS.Open SQL, MyConn
-
IF NOT RS.EOF THEN
-
TITLE = trim(RS("fldTITLE"))
-
CONTENT = trim(RS("fldCONTENT"))
-
SUMMARY = trim(RS("fldSUMMARY"))
-
POSTED = trim(RS("fldPOSTED"))
-
ALLOW_C = trim(RS("fldALLOW_COMMENTS"))
-
ALLOW_V = trim(RS("fldALLOW_VOTING"))
-
UPDATED = trim(RS("fldUPDATE"))
-
AUTHOR = trim(RS("ANAME"))
-
AID = trim(RS("AID"))
-
USE_VIEW= trim(RS("fldUSE_VIEW"))
-
NIMAGE = trim(RS("NIMAGE"))
-
ELSE
-
MESSAGE = MESSAGE & "<li />This article is currently not available."
-
END IF
-
response.write vbNewLine & "<!-- SQL: " & SQL & " -->" & vbNewLine
-
RS.Close
-
-
CONTENT = ReplaceAuthorTokens(AID, CONTENT)
-
CATEGORIES = GET_CATES(NID)
-
-
' Get settings
-
Dim DATE_F
-
DATE_F = GET_SETTINGS(False, "fldDATE_F")
-
-
TITLE = PROCESS_SHORTCUTS(False, TITLE)
-
CONTENT = PROCESS_SHORTCUTS(False, CONTENT)
-
SUMMARY = PROCESS_SHORTCUTS(False, SUMMARY)
-
-
ELSE
-
-
MESSAGE = MESSAGE & "<li />No article has been found."
-
-
END IF
-
%>
and this is the relevant part of the "inc.header.asp" code below -
-
-
<!--#include file="config.asp"-->
-
<!--#include file="inc_api.asp"-->
-
<% Response.Buffer = True %>
-
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
<html>
-
<head>
-
<%
-
title = "article title" %>
-
<title> rs("TITLE")</title>
-
<%
-
meta_description = "the description goes here" %>
-
<meta name="description" content="rs("fldTITLE")">
-
<%
-
meta_keywords = "this, is, the, keyword, section," %>
-
<meta name="keywords" content="RS("fldTITLE")">
However, the above code doesn't pull out the field "title" and display it, when i check the page on the world wide web. When i check the code using "view source" this is what it says: -
<html>
-
<head>
-
-
<title> rs("TITLE")</title>
-
-
<meta name="description" content="rs("fldTITLE")">
-
-
<meta name="keywords" content="RS("fldTITLE")">
So what am i doing wrong? i think i have the code in the "inc.header.asp" messed up somewhere. ~Any help appreciated. 4 1723 Sorry i forgot to add, I'm not html literate, so i'd appreciate it if anyone could show me exactly what to put on both pages
actually i've changed the format now, i no longer need the inc.header.asp page,
so i'm going to put the code at the top of the view.asp page, which is like this, however, it's not picking up the Title. I want the title of the article to be the title of the page, and the meta tags content for description and keywords. The code is as above, so where do i put the
the code to view.asp is in the first post i posted in this thread - <%
-
title = "article title" %>
-
<title><%=title%></title>
-
<%
-
meta_description = "the description goes here" %>
-
<meta name="description" content="<%=meta_description%>">
-
<%
-
meta_keywords = "this, is, the, keyword, section," %>
-
<meta name="keywords" content="<%=meta_keywords%>">
jhardman 3,406
Recognized Expert Specialist Sorry i forgot to add, I'm not html literate, so i'd appreciate it if anyone could show me exactly what to put on both pages
There are some good ways to become HTML literate. It is generally considered an easy-to-learn language. It really isn't a programming language, it is just plain text instruction for how to format text and display web pages. Here is a good tutorial. If you are planning to do all the work of building and maintaining the site, it might be a good idea to find a good reference book. Most public libraries have a few, and every bookstore and computer supply store has several to chose from.
Jared
I will try that, Jared, thanks for the tips.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Christian Hvid |
last post by:
Hello groups.
I have a series of applet computer games on my homepage:
http://vredungmand.dk/games/erik-spillet/index.html
http://vredungmand.dk/games/nohats/index.html...
|
by: Day Bird Loft |
last post by:
Web Authoring | Meta-Tags
The first thing to understand in regard to Meta Tags is the three most
important tags placed in the head of your html documents. They are the
title, description, and...
|
by: laredotornado |
last post by:
Hello,
How effective are META tags when used as tools to classify a page's
content for a search engine? The common one is
<META NAME="Keywords" CONTENT="tropical fish,fish,tetras,guppies">
...
|
by: Fred Nelson |
last post by:
Hi:
I'm developing a new C# Web App and I'm hoping to find a way that I can
dynamically generate meta tags for the search engines at the page level.
(I want to do this so that I can have someone...
|
by: Edward |
last post by:
Hi All,
I am having huge problems with a very simple dotnet framework web page
(www.gbab.net/ztest3.aspx) , it does NOT render correctly under Apple's
Safari. The DIV's do not align amd float as...
|
by: bashetty |
last post by:
Well its a strange problem i have, some of you might already faced it
and have a solution. I have to maintain a set of unique "search key
words" in meta tags for each content page in my site. With...
|
by: karen987 |
last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The...
|
by: runway27 |
last post by:
i have a registration page which is a self submitting form <form action="<?php echo $_SERVER; ?>" method="POST"
id="test2" name="registrationform">
where in a user fill a form, after the data...
|
by: Jordan S. |
last post by:
I'm looking to localize an ASP.NET Web application for English, Spanish, and
French (fr-CA), and was just considering the possibility of localizing the
meta tags (e.g., keywords, title, and...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |