Msg#: 4069426 posted 11:31 pm on Jan 27, 2010 (gmt 0)
I am trying to add a 'http://' for URLs on my website that are missing it. Otherwise the URLs go to 'http://www.example.com/www.example.net/' but I want them to be going to 'http://www.example.net/' if you understand what I mean.
I have added this bit of code to fix it: <a href='<%if instr(WebAddress,"http://") = "" then response.Write("http://")%><%=(RsParent.Fields.Item("WebAddress").Value)%>' target="_blank"><%=(RsParent.Fields.Item("WebAddress").Value)%></a>
The code doesn't work properly though. For URLs with the 'http://' it adds an extra 'http://' rather than leaving it blank. For URLs missing the 'http://' I want to add one in and for URLs with the 'http://' I want to leave it blank. I've also tried an if-then-else-end if statement but the outcome is exactly the same.
Can anyone help?
[edited by: marcel at 1:24 pm (utc) on Jan. 28, 2010] [edit reason] examplified [/edit]