Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Problem Linking Files In Web Page
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem Linking Files In Web Page

 Post Reply Post Reply
Author
kennywhite View Drop Down
Groupie
Groupie


Joined: 26 February 2009
Location: Indy
Status: Offline
Points: 106
Post Options Post Options   Thanks (0) Thanks(0)   Quote kennywhite Quote  Post ReplyReply Direct Link To This Post Topic: Problem Linking Files In Web Page
    Posted: 02 June 2009 at 4:42pm
I am working on a web page where users will upload files and fill out a description of the file.
 
If there is a read me  or help file included, the user will select a check box indicating that there is more information available and type in the location of that file, which will be held on a separate file server, not the web server itself.
 
Alternatively, if there is a website that contains more information about the file, the user would type the URL into the field instead.
 
Here is the code from the page where this info is displayed.
 

<a href="<%=rs("link")%>"><%=rs("more_information")%></a>
 
If the check box on the form was selected a link appears (The check box simply puts the text "More Information" into the proper field of the datase).
 
The problem is that it points to
 
 
instead of
 
 
or
 
 
instead of
 
 
If I change the code to
 

<a href="http://<%=rs("link")%>"><%=rs("more_information")%></a>
 
or
 

<a href="file:\\<%=rs("link")%>"><%=rs("more_information")%></a>
 
it works, but them I am limited to either just files or just web links. I don't know what to do to fix this.
 
Thanks in advance for any help!
Back to Top
cmv View Drop Down
Newbie
Newbie


Joined: 22 May 2009
Location: vienna
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmv Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2009 at 9:56am
this looks like some kind of intranet ... besides it requires the user to authenticate on the fileserver.
 
i could think of a solution which stores the information about the type of the link in the recordset like this simplified example:
\\ points to a fileserver, / points to the root of the webserver, http:// points to an external link
 
strLink = rs("link").Value
If Left(strLink) = "\\" Then intType = 1 Else intType = 0
If intType = 1 Then
 strLink = "<a href=""file:\" & strLink & """>" & ...
Else
 strLink = "<a href=""" & strLink & """>" & ...
End If
Response.Write(strLink)
 
hth, christian
Back to Top
kennywhite View Drop Down
Groupie
Groupie


Joined: 26 February 2009
Location: Indy
Status: Offline
Points: 106
Post Options Post Options   Thanks (0) Thanks(0)   Quote kennywhite Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2009 at 8:38pm
Yes, it is an intranet site and the users are already authenticated to the fileserver.
 
I tried throwing the code in there, but I got this error message:
 
Error Type:
Microsoft VBScript compilation (0x800A03F2)
Expected identifier
/tools_update/functions.asp, line 182, column 50
strLink = "<a href=""file:\" & strLink & """>" & ...
-------------------------------------------------^
 
Any idea why?
 
Back to Top
cmv View Drop Down
Newbie
Newbie


Joined: 22 May 2009
Location: vienna
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmv Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2009 at 2:40pm
yes - you should finish the line (replace ...) according to your needs ;-) eg.
strLink = "<a href=""file:\" & strLink & """>" & strLink & "</a>"
hth, christian
Back to Top
kennywhite View Drop Down
Groupie
Groupie


Joined: 26 February 2009
Location: Indy
Status: Offline
Points: 106
Post Options Post Options   Thanks (0) Thanks(0)   Quote kennywhite Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2009 at 9:50pm
I did that and the error that I have now is:
 
Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'left'
/tools_update/functions.asp, line 182
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.