[UPHPU] server name, http_host & same origin policy

Walt Haas haas at xmission.com
Sun Mar 4 18:55:51 MST 2007


Problem:  My web site is at http://thewebsitedoctor.net or you may refer
to it as http://www.thewebsitedoctor.net .  Either way,
$_SERVER['SERVER_NAME'] contains 'www.thewebsitedoctor.net'.  That's not
a problem until I construct a base URL from the value of SERVER_NAME
then try to use that to load an XML file from the site.  If the user
happened to load the page as 'www.thewebsitedoctor.net' everything is
fine, but if they typed just 'thewebsitedoctor.net' the browser looks at
where the XML is coming from and say "Not the same origin, you lose".

Any bright ideas out there?  Don't put <base> in the <head>?

TIA

-- 
-- Walt
-------
I used to be broke, but since I went to college I've been impecunious.



More information about the UPHPU mailing list