Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy one, Geting my HyperLinks to work properly 1

Status
Not open for further replies.

Larnoc

Programmer
May 13, 2003
3
NZ
I'm sure this is something ridiculously simple

I'm extracting a web address from a database, slapping it into a table as an Href yadda yadd, basic stuff

The problem being that it always puts the address of the site in front, so it ends up
as the hyperlink

I'm guessing that this has been set up like this, and helps the rest of the site, but how do I turn it off when I need to ?

I'd dearly love any help on this :p
 
If the web address is stored in the database as then you need to strip the first bit off.

To do this, first check the address contains then strip the URL:

<%
dbURL = &quot;If InStr(dbURL,&quot;/&quot;)>0 then
LinkURL = RIGHT(dbURL,len(dbURL)-InStr(dbURL,&quot;/&quot;))
Else
LinkURL = dbURL
End If
response.write(&quot;<a href='%>

If is not stored in the database and is added by the code, you need to delve into the code.

Hope this helps,

BDC.
 
As vbkris mentioned, if your not placing an http:// infrom of the address then the browser is going to add the local sitename to the front of the address under the assumption that it is a local address.

If you look at View Source you'll be able to tell if this is the case. View Source will have the address correctly, but when you moiuse over it or try to follow it then it will tack on to the front.

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Brilliant, thanks for that, the Http:// thing worked there, of course it was blatantly obvious, and yes I feel suitable chastised, thank you for the replies

thank you chaps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top