get host URL

C

Christopher Williams

no doubt there are better way to do this , but I have done this in the past

BASE_URL = "http://" & Request.ServerVariables("HTTP_HOST") &
Replace(Request.ServerVariables("URL"),"somefolder/thispage.asp","")

PictureURL = BASE_URL & "pictures"

In the 1st part you replace what you don't want from the current full url to
the page your on
.......based on what ".asp" page/folder you are running at the time.

Then to build your picture folder url you add what folder info you need.

It's going to be slightly different depending on your site layout, where you
are, and the names of your pages and scripts, but this works.

I am sure there is a way better way to do it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,184
Messages
2,570,973
Members
47,530
Latest member
jameswilliam1

Latest Threads

Top