Mordant Monks,

Scratching my head over this. This snippet is in a script accessed over the web:

print "<p>base_url = $base_url\n"; $base_url = 'http://123.456.789.000'; print "<p>base_url = $base_url\n";
which usually correctly produces
base_url = base_url = http://123.456.789.000
But one user is accessing my script through a proxy server. (EZProxy, what else?) When they access it, they get:
base_url = base_url = http://proxy.theirdomain.com:xxxx
The variable $base_url is hard-coded in the script. The fact of coming from a proxy server should have zero effect on that. Now, this script uses only one module, CGI.

Am I unwittingly referencing a special variable or something that's overridding my hard-coded value?

Thanks

UPDATE

Immediately following the above snippet, there comes:

print "<p>at A called_from = $called_from\n"; print "<p>at A base_url = $base_url\n"; @url_parts = split (/$base_url.*?\// ,$called_from); print "<p>at B base_url = $base_url\n"; for $i (0 .. $#url_parts) { print "<br>url_parts[$i] = $url_parts[$i]\n"; }
where "called_from" is the url of the referring page that called the script, set earlier in the script. Again, when I access it, it correctly outputs:
at A called_from = http://123.456.789.000/mysubfolder/mypage.htm at A base_url = http://123.456.789.000 at B base_url = http://123.456.789.000 url_parts[0] = url_parts[1] = mysubfolder/mypage.htm
but when my proxied friend tries it, they get
at A called_from = http://proxy.theirdomain.com:xxxx/mysubfolder/mypag +e.htm at A base_url = http://proxy.theirdomain.com:xxxx at B base_url = http://proxy.theirdomain.com:xxxx url_parts[0] = url_parts[1] =
So, OK, I don't get why it's substituting their proxy domain for the hard-coded $base_url - but considering the value of $called_from, url_parts1 should have been the same mysubfolder/mypage.htm as I get - no? Makes me think there's really something weird going on with this $base_url variable.




Time flies like an arrow. Fruit flies like a banana.

In reply to $base_url special meaning? by punch_card_don

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.