a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

DB Value to Hyperlink

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> DB Value to Hyperlink
Page: [1]
 
evanesnard

 

Posts: 225
Joined: 4/10/2006
Status: offline

 
DB Value to Hyperlink - 6/20/2006 15:09:49   
I need a little help fixing this DB Value to Hyperlink.

I’m trying to display a hyperlink on one of my .asp pages from a value in one of my DB columns.

What I need is to only generate and display a hyperlink if a value exists in the Upload_Doc1 DB column.

I’m currently using the following code:

</b><a href="http://www.mydomain.com/uploads/<%=FP_FieldURL(fp_rs,"Upload_Doc1")%>" style="text-decoration: none">View this document</font></font></td>


This is working just fine…if a file name actually does exist in the DB column.

The problem is if a file name does not exist in the DB column, a link is still created and displayed on the page and the link points to http://www.mydomain.com/uploads/ and of course the user then gets a message in their browser that says “Forbidden, You do not have permission to access this document.”

I thought maybe http://www.mydomain.com/uploads/ could possibly be appended to the <%=FP_FieldURL(fp_rs,"Upload_Doc1")%> asp code, or rather to the value generated by that asp code, so that the http://www.mydomain.com/uploads/ does not even get written unless there’s a value in the DB column.

Any help on this would be greatly appreciated. Thanks.
BeTheBall

 

Posts: 6385
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: DB Value to Hyperlink - 6/20/2006 16:10:58   
You will need to do an If/Then analysis:

<% If Trim(FP_FieldURL(fp_rs,"Upload_Doc1")) <>"" Then %>
</b><a href="http://www.mydomain.com/uploads/<%=FP_FieldURL(fp_rs,"Upload_Doc1")%>" style="text-decoration: none">View this document</font></font></td>
<% Else %>
</b>No document available.</font></font></td>
<% End If %>

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to evanesnard)
evanesnard

 

Posts: 225
Joined: 4/10/2006
Status: offline

 
RE: DB Value to Hyperlink - 6/20/2006 16:24:10   
Thanks Duane! That's exactly what I needed. Works perfect. Thanks again.

(in reply to BeTheBall)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> DB Value to Hyperlink
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts