Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically Updating Web Page of Links/News

Status
Not open for further replies.

ppedersen1

Technical User
Oct 14, 2002
43
0
0
US
Hello,
Everyday I create a document/web page about what happened that day with our group. I therefore have many of these and so I have another web page that has a link to each of them by month. I would like to automate this so that I perhaps just file the web page into a directory and the asp page automatically pulls out the title of the web page and creates a link to it. The resulting page would have a list of links of the daily web pages. So here is the million-dollar question - how do I do that? You would think this is something easy to find. I haven't been able to find this. PLEASE HELP!
 
There are lots of tutorials out there but below is a quick way of doing it I just wrote up.. minus the database connection string etc.. which depends on which db you want to use.. such as Microsoft Access or MySQL.. I prefer MySQL.

Code:
<%
'# db connection
'# create db objects

'# sql statement

strSQL = &quot;Select the_title, the_link from table_name&quot;

'# exe strSQL..

'# loop till end of db..
Do while not rs.eof 

'# write link..
Response.Write &quot;<a href='&quot; & rs(&quot;the_link&quot;) & &quot;'>&quot; & rs(&quot;the_title&quot;) & &quot;</a><br><br>&quot;

'# move to next record in recordset
rs.movenext
loop

%>

www.vzio.com
ASP WEB DEVELOPMENT



 
Hi
You can use the FileSystemObject to enumarate all the files in a folder and also you can use it to open and read your HTML files.After that creating the link will be very easy

HTH
 
I would you a database, much more efficient then FSO www.vzio.com
ASP WEB DEVELOPMENT



 
But you dont need a database here. If you use a database every time you create a HTML file you have to add a record to the DB. But if you use a FSO approach you can just create the HTML file drop it in the specified folder and thats all.

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top