$q->self_url Unreliable

J

Julia De Silva

Hi there all,

Is there a 100% reliable way to return the current URL of the script.
I have used $q->self_url but this doesn't seem to work on all servers. I'd
rather use cgi.pm than $ENV{} if poss.

TIA

J
 
J

Jürgen Exner

Julia said:
Is there a 100% reliable way to return the current URL of the script.
I have used $q->self_url but this doesn't seem to work on all
servers. I'd rather use cgi.pm than $ENV{} if poss.

Did you check the specification of the Common Gateway Interface if this
information is required?

jue
 
J

John Bokma

Mike said:
Is there an official specification now? There wasn't as of several
years ago -- it was just sort of defined by the behavior of the NSCA
(then Apache) server behavior, plus a little web page at
ncsa.uiuc.edu.

There is some question as to what is meant by current URL. Is it
the SCRIPT_NAME without PATH_INFO?
no

Does it include the QUERY_STRING?

yes

The current URL would be in my opinion what one sees in the addressbar
when the script is called.

"self_url() will return a URL, that, when selected, will reinvoke this
script with all its state information intact. "

If self_url excludes either PATH_INFO or QUERY_STRING it's wrongly
implemented IMNSHO, or the documentation is incorrect (I consider
PATH_INFO state information too).

" Semicolon-delimited query strings are always accepted, but will not

be emitted by self_url() and query_string() unless the -
newstyle_urls pragma is specified.

This became the default in version 2.64."
 

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,266
Messages
2,571,083
Members
48,773
Latest member
Kaybee

Latest Threads

Top