SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For a distributed script, what is the best way to go about doing this? i know if php is run as a cgi process then it does not work proprely (a user was getting part of their path/to/file in the script).

    Is there a fail safe routine to use so that it will work whatever the user is using or is it better to use the filename.php in form actions/links instead?

    Recommendations please...

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would put together a file called php_self.php, and in ti I would put this(For fixing the CGI problem):
    PHP Code:
    <?
    $PHP_SELF 
    $PATH_INFO;
    ?>
    Then if the user is running php in CGI mode have them stick that file somewhere in the web root and then create a .htaccess file in the web root with the following line it

    php_value auto_prepend_file "/somepath/www/somemorepath/php_self.php"




    What this does is automatically prepned that file to every page that uses php, that way $PHP_SELF will always have correct value even when in CGH mode
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not with you? , $PHP_SELF should return exactly that in all cases as far as I am aware.

    $DOCUMENT_ROOT can cause problems accross different servers but I cant see where $PHP_SELF would.


    I note freddys reply, so there must be something happening that I can not see! - I do all my dev work locally as a CGI and almost all my work online is as an apache Module... with no problems so far , what am I missing!!!

  4. #4
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool, nice idea freddy... thanks.

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    firepages unless something has changed $PHP_SELF, will point to the php interpreter then tack on the rest of the url so a link would turn into


    php/php.exe/pages/step1.php

    instead of

    pages/step1.php



    I am assumiong this is what is happening with padders, it happened to me a while back and I made php work with apache asa module on windows and now I don't have that problem anymore. So firepages does this not happen to your scripts?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  6. #6
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no not quite, the person was getting:

    http://www.domain.com/htdocs/helpdesk/admin/admin.php

    when submitting a form from:

    http://www.domain.com/helpdesk/admin/admin.php

    this is using native sessions.php but i am wondering, i have an include file of the forum include "../filename.php" do you think that could cause a problem?


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
  •