SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    770
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Helping out with a problem caused by disallowed parent paths

    I have a friend who has just uploaded a basic ecommerce application and on trying to view the site the site came back with a error 500 and when I checked the error logs it seemed to be because of disallowed parent paths.

    Ive looked into it briefly and need some advice, I'm guessing its because of code like below.

    Code:
    <!--#include file="_INCappDBConn_.asp"-->
    <!--#include file="_INCconfig_.asp"-->
    <!--#include file="_INCappFunctions_.asp"-->
    <!--#include file="_INCprodFunctions_.asp"-->
    <!--#include file="../usermods/_INCtools_.asp"-->
    I think I have to firstly change the include file to include virtual which solves the first 4, but with the 5th I think I need to put the path in rather than using '..' is that right, but how do I get to the root level without using '..'

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,609
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Is this dedicated hosting or shared hosting? Assuming shared ...

    Code:
    <!--#include virtual="/accountname/usermods/_INCtools_.asp"-->
    (Assuming usermods folder is in the account root).
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    770
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, no usermods is a folder on the root level, in the httpdocs folder so basically would it just be

    Code:
    <!--#include virtual="/usermods/_INCtools_.asp"
    And the path the file containing the code above is - httpdocs/scripts/default.asp

    So as it was before, it was returning to the httpdocs folder '..' and then going into the usermods folder

    Would it be instead...


  4. #4
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    770
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi siteguru, I'm sorry I thought you had accountname there as a folder name, I can see what your getting at but what do you mean by accountname, how would I know that.

    Sorry I should have looked at your reply better

  5. #5
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,609
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    On a shared hosting platform each user (account / website) may have a folder off the webroot folder. Starting a path with "/" tends to mean "start mapping from the webroot folder". Try the following in an ASP page ...

    Code:
    <% Response.Write Server.MapPath("/") %>
    That might help understand the folder structure and how it is configured.
    Ian Anderson
    www.siteguru.co.uk

  6. #6
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    770
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK I did that and it came back with :

    e:\Plesk\celebrityfragrances.co.uk\httpdocs

    so would using below be enough to go to the root level

    Code:
    <!--#include virtual="/httpdocs/usermods/_INCtools_.asp"-->
    When orifinally it was:

    Code:
    <!--#include file="../usermods/_INCtools_.asp"-->

  7. #7
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    770
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I was to give access to the files and let you know the domain name could someone take a look, and point me in the right direction as I seem to be getting nowhere with it.

    Cheers

  8. #8
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    770
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It wouldnt be so bad if I could at least see the proper error, what line it is and all, but there no option is there like in php/

    Ive been trying ot make out what the problem actually is and somethin I have noticed is that it doesnt matter what the path of the include is whether the file is in the same folder or not the first include is where the problem is.

    For instance this is one of the errors in the log

    2013-08-23 16:10:25 W3SVC59 vesta2 91.222.11.11 GET /scripts/emailToFriend.asp idProduct=182|19|ASP_0126|Include_file_not_found 80 - 66.249.78.167 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) - - www.celebrityfragrances.co.uk 500 0 0 1653 282 31

    Ive osrt of worked out that the 19 just after idProduct=182| is the line where the problem is, and as it goes its the line where the first include starts

    Code:
    <!--#include virtual="_INCconfig_.asp"-->
    Then on another error in the log file but this time in another file, that number again corresponds with the first include, so by the seems there something it doesnt like about it regardless of the path being to a file in a different folder or in the same folder.

    Does this highlight anything

  9. #9
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,609
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    OK. httpdocs is the webroot folder. So all that should be needed is:

    Code:
    <!--#include virtual="/usermods/_INCtools_.asp"-->
    For the other files, what folder are they contained within? I'm assuming they are in the same folder as the default.asp file (for that ecommerce application), so assuimg it is called "ecommerce" and this is within the httpdocs folder then:

    Code:
    <!--#include virtual="/ecommerce/_INCappDBConn_.asp"-->
    <!--#include virtual="/ecommerce/_INCconfig_.asp"-->
    <!--#include virtual="/ecommerce/_INCappFunctions_.asp"-->
    <!--#include virtual="/ecommerce/_INCprodFunctions_.asp"-->
    I suspect the usermods folder is configured with WRITE access, hence why that INC file is in there rather than in the default folder.

    I trust this provides some guidance.
    Ian Anderson
    www.siteguru.co.uk

  10. #10
    SitePoint Addict itHighway's Avatar
    Join Date
    Jan 2008
    Location
    GUJ
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Two ways to resolve the issue:

    1- Use virtual path, as mentioned in most of answers of this thread.
    2- Your control panel may have the option to turn on/off parent path.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •