I want to create a dynamic link to a file...basically the info is displayed in a .php template read in from MySQL db. I want to also have a link to the saved text file. Here is some of what I have:



and later in the form:

echo"<a href='file:///N:/'$fileDir'/'$fileID>Link to text file</a>(testing)";

Having trouble with the format...is this something that can be done?



Here you forgot to put ; ...


This is working, but I don't know what exactly do you want :

echo"<a href='file:///N:/$fileDir/$fileID'>Link to text file</a>(testing)";

Thanks for pointing that out, still can't get it to work. I am trying to create a link to a file with the following naming convention N:/TOPRShiftlog/2007-12-02_RShift.rtf

the Directory "R" has to be dynamic, being read in with 2 other possibilities, date being read in and the last "R" being dynamic as there are also 2 choices.

I used for date '2007-12-12' and for shift 'R' :




echo"<a href='file:///N:/$fileDir/$fileID'>Link to text file</a>(testing)";


This code return me a link pointing to 'file:///N:/TOPRShiftlog/2007-12-12_Rshift.rtf' ...
This is what you want when I read the previos post.

Thanks for the help. The problem was the "." before the date. It is not being appended to anything so no "." needed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.