•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,988 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,790 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 929 | Replies: 4 | Solved
![]() |
•
•
Join Date: Oct 2007
Posts: 37
Reputation:
Rep Power: 2
Solved Threads: 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:
and later in the form:
Having trouble with the format...is this something that can be done?
Thanks
DS
$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
•
•
Join Date: Jul 2007
Location: Sofia, Bulgaria
Posts: 138
Reputation:
Rep Power: 2
Solved Threads: 10
Hi.
Here you forgot to put ; ...
This is working, but I don't know what exactly do you want :
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)";
•
•
Join Date: Oct 2007
Posts: 37
Reputation:
Rep Power: 2
Solved Threads: 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.
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.
•
•
Join Date: Jul 2007
Location: Sofia, Bulgaria
Posts: 138
Reputation:
Rep Power: 2
Solved Threads: 10
I used for date '2007-12-12' and for shift 'R' :
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.
<?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.
Last edited by MitkOK : Dec 5th, 2007 at 4:29 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: Image not getting refreshed automatically
- Next Thread: Uploading and resizing images


Linear Mode