Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Browser dependent CGI script failure?

by matija (Priest)
on Apr 14, 2004 at 05:20 UTC ( #344926=note: print w/replies, xml ) Need Help??


in reply to Browser dependent CGI script failure?

Your problem is here: print div("<a href = \"?closeup=$section&image=$image\">.

You are using a relative URL of a form that is not strictly standard, supplying only the parameters of the script, without the script name (or the directory, etc). Some browsers fill out the script name automatically, some don't.

I strongly suggest that you use either self_url or url() methods (provided by CGI.pm) to determine the URL of your script and explicitly use them in links.

That way, you will retain the ability to move the script to other machines/directories and have it work automatically, and avoid the browser dependent interpretation of the relative URL RFCs.

Replies are listed 'Best First'.
Re: Re: Browser dependent CGI script failure?
by Anonymous Monk on Apr 14, 2004 at 06:17 UTC
    Some browsers fill out the script name automatically, some don't.
    Like what browser? All browsers should support this. It's a standard relative uri, perfectly legal. See http://www.rfc-editor.org/rfc/rfc1738.txt http://www.ietf.org/rfc/rfc2396.txt.
      uhm...
      RFCs are not law - and ultimately, it is up to the browser manufacturers, whether they adhere to them or not.
      (if browsers all followed the standards - webdesigners wouldn't be having as many compatibility discussions.)
        You are using a relative URL of a form that is not strictly standard
        It's a standard relative uri, perfectly legal.
        That's why I ask to give an example. Unless it's some homemade browser, it'll work.
      It is open to interpretation if it is a legal relative URI. The relativeURI grammar in RFC 2396 defines that the relative path must have at least a single character before the query string. However, the examples include '?y' as a relative URL. RFC 1808 allows just a query string and specified the resolution rules for it.
Re: Re: Browser dependent CGI script failure?
by markmoon (Deacon) on Apr 14, 2004 at 05:37 UTC

    Thank you very much. I wasn't aware of that, but I promise not to forget in the future.

    markmoon

    --
    @a = ("a".."z"," ","-","\n");foreach $b ( 12,0,17,10,24,12,14,14,13,26,8,18,26,0,26, 22,0,13,13,0,27,1,4,26,15,4,17,11,26,7,0, 2,10,4,17) {print $a[$b]};print $a[28];
Re: Re: Browser dependent CGI script failure?
by zetetes (Pilgrim) on Apr 14, 2004 at 22:17 UTC
    uh,
    you just kept me from doing this mistake, too. wasn't aware of it at all...

    and thanks to markmoon for asking this in here...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://344926]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2021-09-23 06:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?