0

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:

$date=$_POST[Date_Entered];
$shift=$_POST[shift];
$shift_table=$shift."_shift_duties";

$fileDir="TOP".$shift."Shiftlog"
$fileID=.$date."_".$shift."shift.rtf";

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?

Thanks
DS

2
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by drsmith
0

Hi.

Here you forgot to put ; ...

$fileDir="TOP".$shift."Shiftlog"

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)";
0

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.

0

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

<?php

$date='2007-12-12';
$shift='R';
$shift_table=$shift."_shift_duties";

$fileDir="TOP".$shift."Shiftlog";
$fileID=$date."_".$shift."shift.rtf";

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.

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.