Here's the thing - I need to create some sort of code that receives information from the back end of a site and dynamically adds a link on an overview page of that new article and also creates a new webpage with the article on it.
I'm not quite sure where to start or how to go about doing this. If anyone could give me a push in how to get started or maybe explain how the code would work?
**The link will reside on a page built with HTML**
Any help is greatly appreciated....
If necessary I'll use PHP (but I don't have any experience with that either :-/ )
With your overview page have a sql statement that creates the links. To do this have one of your columns in the database table reference the title of the article. Then when calling the title also request the primary key from the database for that article.
Create a do until end of record set and populate the page with anchors created from this data:
[Inside table] Do Until objRS.EOF Response.Write "<td><a href ='ShowArtical.asp?Artical="&rs(“Article_ID”)&" '>”&objRS(“article_Name”)&”</a></td>" objRS.Move.Next Loop [Inside table]
If you want to get fancy you can add another row under the link to show the first part of the article and use CSS to make the link to the article the same colour text as the rest of your page.
In the page I called ShowArtical.asp you will need to grab the Article_ID from the query string
Article_ID = Request.QueryString("Article_ID ")
Create another SQL statement where your ID column equals the Article_ID variable
SELECT A_Title, A_Body, A_ID
WHERE A_ID = Article_ID
Open your database and create a record set.
Place the data from the record set how you want it formatted within the page
[Inside table] Response.Write "<tr>" Response.Write "<td>” & objRS(“A_Title”) & “</td>" Response.Write "<tr>" Response.Write "<td >” & objRS(“A_Body”) & “</td>" Response.Write "<tr>" [Inside table]
If I understood your question correctly that’s about it. ShowArtical.asp will be used for all the articles. You may also want to put a date column in the database so you can query only articles written within a certain timeframe. You may also want a page that has a text box for the title and body of a new article to insert into the database.