Naming anchor via link to database
Posted 31 May 2006 - 08:41 PM
So far, I have scripted my pages so that a title and summary of a news item appears on the homepage, followed by a link to the main news page.
The main news page is scripted so that everything in the database shows up.
My aim is to be able to add an anchor to each of the news articles on the main page, the name of the anchor to be determined by the id in the database. But I cannot figure out how to make that happen.
Once that is achieved, I also need to be able to rescript to the link on the home page so that it will take you to the actual news article, so rather than having www.mysite.com/news, the link could then be www.mysite.com/news#2 (again, scripting it so it automatically adds the appropriate id to the link.)
I've no idea if this is possible, but it's worth a try at finding out. Otherwise I'm quite happy to stick with all the articles on one page and making my readers sift their way through the articles! [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]
Posted 31 May 2006 - 10:33 PM
Working backwards is always a good method.
create yourself a simple sample page (no need for more than 3 test links/anchors). use the article id from the database as the name of the anchor tags. hard code it, do NOT use php or mysql yet.
then create the 'index' page (the one that has the links TO the articles on the first file).
at that point ask yourself how you would use php to change the names of the anchor tags/links.
I think you'll grab the process quickly.
[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture
all the brothers were valiant!
Posted 10 June 2006 - 11:46 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users