4 replies [Last post]
djsounds02
djsounds02's picture
Offline
Enthusiast
Burnley, UK
Last seen: 8 years 46 weeks ago
Burnley, UK
Joined: 2010-06-17
Posts: 110
Points: 134

hey guys I need a tool that will add links for me I have a folder with lots of html pages and I want the program to see the file names of all the htmls and add them in a file as hrefs?

Tags:
Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 14 weeks 1 day ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

!?

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 49 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

If you're using PHP you want

If you're using PHP you want opendir and readdir.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

djsounds02
djsounds02's picture
Offline
Enthusiast
Burnley, UK
Last seen: 8 years 46 weeks ago
Burnley, UK
Joined: 2010-06-17
Posts: 110
Points: 134

Its just for the inital

Its just for the inital getting the coding up for a html page without typing a 1000 pages out as hrefs lol

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 14 weeks 1 day ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

Here's how you do it in

If you need to output a list of files in a directory, here's how you do it in ASP.NET C#:
IList files = Directory.GetFiles(Server.MapPath("~/files/pages/"));

The variable files now contains a list of paths for files in /files/pages/. Then you can run a foreach(var file in files){ ... } to output what you need. You can also filter it by file extension by using .EndsWith();