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 first part is in the inc.header.asp file which is called up on every page. The page itself has the meta tag variable, ie. title, description. They work fine on all pages, except the one below i'm having problems with. Ironically it's the most important page, because it's the page that shows the full page article. (view.asp) The reader reaches view.asp by clicking on the article headline in the page before for example here it is called "articlelist.asp". I have included relevant code from the 2 pages here,


Here is a bit of relevant code from the page where the news links are listed (lets call it "articlelist.asp") is this one, and here is one such link, which is a headline, summary and possible image, and other info.


Code:
                    <div align="justify"><a class="aTITLE_BLUE" href="view.asp?ID=<%=NID%>"><%=TITLE%></a><br />					
                                                <%IF NOT (IMAGE = "" OR IsNull(IMAGE)) THEN%>
	                  <img src="<%=IMAGE%>" width="50" height="50" align="left" />
                      <%END IF%>					
      <span class="style2"><%= FormatDateTime(POSTED,DATE_F) %></span> <span class="tdSUMMARY"><%= SUMMARY %> </span>
      <%IF NOT I_SIDE = SHOW_HL THEN%>
    </div>
                    <hr align="JUSTIFY">
                    <div align="justify">
                      <%End If%>
When a reader clicks on the link above, it takes them to the complete article which is view.asp page with the added NID article number showing in the url.

What happens at present , is that the meta tags on all the view.asp pages are the same, as i've put them at the top of the view.asp page. Obviously i need to add them to the article when i do it at the admin side of the software. These articles are not as include files Bill, the include files are soemthing else. The articles are pulled up as you will see below.



Below are the relevant parts of the view.asp page, where the article is actually shown. The page is split in 3 columns. The first column is called "left column" there is some code here, which i didn't bother showing you as the article is in the middle column, ie. "main article" column which is where the news article is pulled from the database, and the third column is pulled from "inc.footer.asp", again irrelevant. Thus the "left column" and "inc.footer" column are no problem, its the "main article" that needs attention and as you will see the title of the article is called from the database. It is included in the page content, but i want to make sure that each view.asp page shows the title and other meta detail . From the code that shows now, the meta tags are always the same no matter what the article as they are added at the top of the view.asp. I need to add them to the database i think. Am i correct? I hope not, i hope i can add them to the article when i am adding it from the admin software.....i tried this, ie. adding it as code, but the problem then was it didn't show in the header of the view.asp page, it showed only in the content of the article when i viewed "view source" from the web.



Code:
<% 
title = "article title" 
meta_description = "the description goes here" 
meta_keywords = "this, is, the, keyword, section," 
%> 
<!--#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
    %>
        
    <% IF NOT MESSAGE = "" THEN %>
        <!--#include file="inc_error.asp"-->
    
        <% Response.End %>
    <% END IF %>            

		
	<%IF USE_VIEW = "1" THEN ' News Agency Template %>		
		
	
			<table width="658" align="center" cellpadding="2" cellspacing="0" border="0">
			  <tr>
				<td width="150" valign="top">
					<!-- Left Column -->
						
														
						
					<!-- [ Left Column ] -->				</td>
				<td width="460" valign="top">
					<!-- Main Article -->
				
					
						<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
 <tr>
   <td colspan="6" align="left" class="ArticleTitle"><%= TITLE %></td>
   <tr>
    <td align="left" valign="bottom">Filed under  <em><%=CATEGORIES%></em> - on <%= FormatDateTime(POSTED,DATE_F) %>
        <%IF SHOW_AUTHOR = True THEN%> - By: <%=AUTHOR%> <%END IF%> </td>      
   
		
						<hr size="1" style="color: grey;height: 3px;width: 100%;"/>
   <div class="tdSUMMARY"><%=CONTENT%></div> <br />
 
     <br />
     <br />
	 
	 <a href="#talkback1" class="CateLink" >Comment on this article! Talkback</a><br />
    
						
			
						<% END IF ' { IF USE_VIEW = "1" THEN ' News Agency Template  } %>
	
	
  <p>&nbsp;        </p>
	                        <p>
	
	
    <%
    MyConn.close     
    Set MyConn = Nothing    
    %>  
<!--#include file="inc_footer.asp"-->