Invalid URL form or fully-qualified absolute URL was used. Use relative URLs

R

Rudi Ahlers

Please help, I have tried all possible routes.

I have a table with a layout, and in one of the cells, I have :
<%=server.Execute(page)%>

The code that gives me this problem is:

newslink = request.QueryString("n")
IDno = request.QueryString("ID")


if newslink <> "" then
page = "news/" & newslink & ".asp"
If objFSO.FileExists("/news/" & page) = false Then
page = "news/news.asp"
End If
if IDno <> "" then
page = page & "?ID=" & IDno
end if
else
page = "home.asp"
end if


Now, when I type the following URL in,
http://localhost/newhp/index.asp?n=news, then it works fine
If, however I type in http://localhost/newhp/index.asp?n=news&ID=71, I get
the above error.

all the news stuff is in a seperate folder, but that shouldn't be a problem.
Please help?
--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
 
X

xxxxx

On Sat, 10 Apr 2004 15:30:36 +0200, "Rudi Ahlers"

I think The "page" variable needs to be a string that is like
"/yourvirtualdirectory/nameofpage.asp" ... a "relative" url that is
under your root web directory...

currently it thinks you're trying to use a "fully qualified" url that
could be in another domain or something...
 
R

Rudi Ahlers

Not quite, server.execute doesn't work with querystrings.........
Like I said, I tried all possible options, adding a "/" to it, having the
whole path, etc.
See, when it's just index.asp?n=news, then it works, but the moment I add
something to it, like index.asp?n=news&ID=71, then it bombs out

Check this URL: http://www.aspfaq.com/show.asp?id=2030

What a bummer. I was hoping though somebody have a different solution?

--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
On Sat, 10 Apr 2004 15:30:36 +0200, "Rudi Ahlers"

I think The "page" variable needs to be a string that is like
"/yourvirtualdirectory/nameofpage.asp" ... a "relative" url that is
under your root web directory...

currently it thinks you're trying to use a "fully qualified" url that
could be in another domain or something...
 
X

xxxxx

On Sat, 10 Apr 2004 16:17:08 +0200, "Rudi Ahlers"

I didn't see all the text in your post. Yeah, you're right, it
doesn't work with query strings... I found that out early on...

What the hell good is this extra asp 3.0 function if it doesn't work
with a query string... ????

I guess It's really just a replacement for includes.

I think "transfer" is supposed to be able to use the variables
explicitly defined on the calling page? or something?

Just store the vars in a session. I throw them in a dictionary in
some of my projects.
 
X

xxxxx

On Sat, 10 Apr 2004 15:43:06 +0100, "Andrew Urquhart"

Yup. It does work. I gave up on that method... now it's fresh as a
daisy.
 
J

Jeff Cochran

Please help, I have tried all possible routes.

I have a table with a layout, and in one of the cells, I have :
<%=server.Execute(page)%>

The code that gives me this problem is:

newslink = request.QueryString("n")
IDno = request.QueryString("ID")


if newslink <> "" then
page = "news/" & newslink & ".asp"
If objFSO.FileExists("/news/" & page) = false Then
page = "news/news.asp"
End If
if IDno <> "" then
page = page & "?ID=" & IDno
end if
else
page = "home.asp"
end if


Now, when I type the following URL in,
http://localhost/newhp/index.asp?n=news, then it works fine
If, however I type in http://localhost/newhp/index.asp?n=news&ID=71, I get
the above error.

all the news stuff is in a seperate folder, but that shouldn't be a problem.
Please help?

Use a Response.Write to print the variables and the resulting URL to
ensure you're getting what you expect. If need be, paste that result
into your browser and see what is returned from a direct request.

Jeff
 
R

Rudi Ahlers

I dunno why, but this works:

if newslink <> "" then
page = "news/" & newslink & ".asp"
If objFSO.FileExists("/news/" & page) = false Then
page = "news/news.asp"
End If
else
page = "home.asp"
end if

My logic told me that I would need to give the URL the ID string, since this
wasn't really part of the original querystring.

This is the URL I use:
http://hobbit/newhp/index.asp?n=news&ID=60, and like I said, it works. when
I do a response.write, it displays the following:
news/news.asp - i.e. without the rest of it. This this is the page variable
which I run as follows:
server.execute(page)

I can't explain, cause my logic tells me that if the page variable doesn't
have the "ID=60" string, it shouldn't display it, yet it does.

--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
Please help, I have tried all possible routes.

I have a table with a layout, and in one of the cells, I have :
<%=server.Execute(page)%>

The code that gives me this problem is:

newslink = request.QueryString("n")
IDno = request.QueryString("ID")


if newslink <> "" then
page = "news/" & newslink & ".asp"
If objFSO.FileExists("/news/" & page) = false Then
page = "news/news.asp"
End If
if IDno <> "" then
page = page & "?ID=" & IDno
end if
else
page = "home.asp"
end if


Now, when I type the following URL in,
http://localhost/newhp/index.asp?n=news, then it works fine
If, however I type in http://localhost/newhp/index.asp?n=news&ID=71, I get
the above error.

all the news stuff is in a seperate folder, but that shouldn't be a problem.
Please help?

Use a Response.Write to print the variables and the resulting URL to
ensure you're getting what you expect. If need be, paste that result
into your browser and see what is returned from a direct request.

Jeff
 
J

Jeff Cochran

I dunno why, but this works:

if newslink <> "" then
page = "news/" & newslink & ".asp"
If objFSO.FileExists("/news/" & page) = false Then
page = "news/news.asp"
End If
else
page = "home.asp"
end if

My logic told me that I would need to give the URL the ID string, since this
wasn't really part of the original querystring.

This is the URL I use:
http://hobbit/newhp/index.asp?n=news&ID=60, and like I said, it works. when
I do a response.write, it displays the following:
news/news.asp - i.e. without the rest of it. This this is the page variable
which I run as follows:
server.execute(page)

I can't explain, cause my logic tells me that if the page variable doesn't
have the "ID=60" string, it shouldn't display it, yet it does.

I think Andrew hit it correctly, you're doing a Server.Execute and
trying to use a query string. He posted a work-around, but you might
skip the Server.Execute and just pass the query on the URL with a
redirect.

Jeff
 
A

Aaron Bertrand [MVP]

Actually I'm surprised to see that querystrings not working on
Server.Execute paths is classed as a bug.

Well, to me, it is. It seems like something that COULD be supported.
AFAIK all CGI/state/environment data available to the calling page is
available in the Server.Execute'd page, not just the ServerVariables,
e.g. form collections, cookies, etc.

Which is fine, if the calling page was, itself, called with the desired
parameters. But much like the dynamic #include paradigm, there will always
be the desire of a portion of users to call a page with conditional
querystrings that are derived in the calling page, not before.

A
 
L

Lord Merlin

This is rather true, and I'm sure it would be nice if MS can work on this.

I can do this in PERL / PHP:

<?
if (page == "1")
include "1.php"
elseif (page == "2")
include "2.php")
elseif(page == "ext")
include http://www.somedomain.name/file.php
else
include "3.php"

?>


This allows for much more flexibility, and it would be nice to have used it
in ASP as well. I haven't used ASP.NET yet, so I'm not sure if it can be
done. But in this case the client's hosting is on ASP, so I need to work
with what I got
--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
Aaron Bertrand said:
Actually I'm surprised to see that querystrings not working on
Server.Execute paths is classed as a bug.

Well, to me, it is. It seems like something that COULD be supported.
AFAIK all CGI/state/environment data available to the calling page is
available in the Server.Execute'd page, not just the ServerVariables,
e.g. form collections, cookies, etc.

Which is fine, if the calling page was, itself, called with the desired
parameters. But much like the dynamic #include paradigm, there will always
be the desire of a portion of users to call a page with conditional
querystrings that are derived in the calling page, not before.

A
 
A

Aaron Bertrand [MVP]

This allows for much more flexibility, and it would be nice to have used
it
in ASP as well.

You can, the problem we're discussing is querystrings. This works fine:

if something then
server.execute "page1.asp"
else
server.execute "page2.asp"
end if

There are also other workarounds for "dynamic includes" ... see
http://www.aspfaq.com/2042
 

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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top