Webroot annoyances

    Date: 10/17/07 (PHP Community)    Keywords: php, security, web

    Does anyone have some sort of clever idea for this.

    Imagine that you have a series of nested folders.

    URL/A
    URL/A/images
    URL/A/B
    URL/A/C

    Now normally the website for C would be URL/A/C/index.php and using img src='/A/images/something.jpg' would work just fine.

    Except that for some reason we have another domain name / url prefix that points the web root to URL/C. Meaning img src='/A/images/something.jpg' does not work because now it is looking at /A/A (folder does not exist)/images/something.jpg.

    Still more annoying, our users are retarded sheepish and afraid of warnings from IE in the event of say using a full filepath ( http://URL/A/images/image.url ) since the domain is different it throws a security warning that "we cannot afford to have". Argh.

    I have no control over the domain name and it is not going away anytime soon much to the rest of our grievances.
    Does anyone have an "easy" way to deal with this problem? I suppose I could use $_SERVER['DOCUMENT_ROOT'] to detect it, but that seems like an awful lot of work, considering I'll have to do it for every image on the stupid site.

    (this is why people should not be allowed to access the same webpage from multiple URLs *grumble*)

    Source: http://community.livejournal.com/php/591911.html

« Hi guys. I need help in PHP... || Detecting duplicates in an... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home