Gossamer Forum
Home : Products : DBMan : Discussions :

Creating Linked Files

Quote Reply
Creating Linked Files
I need to set up my DB so that one category is a link to a file on my server. HELP - I can't figure out how to make this work.

I either get a hidden field in the view record form, or the file comes up with a link but the link doesn't work.

Any help would be GREATLY appreciated!!!

Quote Reply
Re: Creating Linked Files In reply to
Assuming your category fieldname is Category and the category seletion is called "File" with the filename being called catfile.txt you could use something like this in your sub html_record or sub html_record_long:

|; # to close off a previous print qq| statement

if ($rec{'Category'} eq "File") { print qq|<A HREF="catfile.txt">Click here</A> |;
}
else {
print qq| $rec{'Category'} |;
}
print qq|

Hope this helps and is what you were looking for

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Creating Linked Files In reply to
FWIW there's no need to use print qq||; when you are only printing one variable.

You would only need...


Code:
|; # to close off a previous print qq| statement

if ($rec{'Category'} eq "File") { print qq|<A HREF="catfile.txt">Click here</A> |;
}
else {
print $rec{'Category'};
}
print qq|
Mods:http://wiredon.net/gt/download.shtml
Installations:http://wiredon.net/gt/