User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Oct 2007
Posts: 37
Reputation: drsmith is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
drsmith drsmith is offline Offline
Light Poster

Passing VRB's within HTML href tag

  #1  
Dec 5th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2007
Location: Sofia, Bulgaria
Posts: 138
Reputation: MitkOK is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 10
MitkOK's Avatar
MitkOK MitkOK is offline Offline
Junior Poster

Re: Passing VRB's within HTML href tag

  #2  
Dec 5th, 2007
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)";
Reply With Quote  
Join Date: Oct 2007
Posts: 37
Reputation: drsmith is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
drsmith drsmith is offline Offline
Light Poster

Re: Passing VRB's within HTML href tag

  #3  
Dec 5th, 2007
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.
Reply With Quote  
Join Date: Jul 2007
Location: Sofia, Bulgaria
Posts: 138
Reputation: MitkOK is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 10
MitkOK's Avatar
MitkOK MitkOK is offline Offline
Junior Poster

Re: Passing VRB's within HTML href tag

  #4  
Dec 5th, 2007
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.
Last edited by MitkOK : Dec 5th, 2007 at 4:29 pm.
Reply With Quote  
Join Date: Oct 2007
Posts: 37
Reputation: drsmith is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
drsmith drsmith is offline Offline
Light Poster

Re: Passing VRB's within HTML href tag

  #5  
Dec 6th, 2007
Thanks for the help. The problem was the "." before the date. It is not being appended to anything so no "." needed.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:31 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC