#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Sweden
    Posts
    4
    Rep Power
    0
    I run php4 on a redhat linux box w/apache-1.3.12. I also have MySQL-3.22.32 installed.
    It seems like I can't reach HTTP_ENV_VARS from within a php script but it works from the phpinfo() function.
    I discovered it when I got the following warning:
    Warning: Undefined index: PHP_SELF in ../application.php on line 46
    the code looked like this:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>$ME = $PHP_SELF;[/code]
    I also tried this variant:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>$ME = $HTTP_GET_VARS["PHP_SELF"];[/code]
    I then tried the following:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><?echo "PHP_SELF: $PHP_SELF";?>[/code]
    Result:
    PHP_SELF:
    If anyone have any idea of what is wrong, please give me an answer.


    ------------------
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    not an answer as such , but does this happen in both browsers?

    My version of NS (4.73) takes $PHP_SELF to mean the root of whichever domain, when running under Apache on my win98 and on linux/redhat/Apache on my server.

    So I end up having to do without it.

    People have (and will again) told me that it can not be a browser issue! - and while they are probably right all I know is what I see.

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Kingsland, GA USA
    Posts
    1
    Rep Power
    0
    I had the same trouble...got around it by setting PHP_SELF as a global in the file I was calling.

    <?php
    global $PHP_SELF;
    $me = basename($PHP_SELF);

    echo("I am on page: $me");
    ?>

    Have a great day,

    Bill

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by soed:
    I run php4 on a redhat linux box w/apache-1.3.12. I also have MySQL-3.22.32 installed.
    It seems like I can't reach HTTP_ENV_VARS from within a php script but it works from the phpinfo() function.
    I discovered it when I got the following warning:
    Warning: Undefined index: PHP_SELF in ../application.php on line 46
    the code looked like this:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>$ME = $PHP_SELF;[/code]
    I also tried this variant:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>$ME = $HTTP_GET_VARS["PHP_SELF"];[/code]
    I then tried the following:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><?echo "PHP_SELF: $PHP_SELF";?>[/code]
    Result:
    PHP_SELF:
    If anyone have any idea of what is wrong, please give me an answer.

    [/quote]

  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    6
    Rep Power
    0
    Not ure if this will help but have you used refresh($HTTP_ENV_VARS)
    Often reuired before you can use that sort of entity
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Sweden
    Posts
    4
    Rep Power
    0
    I get the following error when I put refresh($HTTP_ENV_VARS) in my *.php file
    Fatal error: Call to undefined function: refresh() in /home/httpd/htdocs/auth/session_test.php on line 2
    And I don't seem to find any references to the function refresh() either.
    As I am a newbie to PHP ans don't know much about it I might have missed something obvious. Could you please tell me how to do it?
    TIA
    /soed
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by gordonh:
    Not ure if this will help but have you used refresh($HTTP_ENV_VARS)
    Often reuired before you can use that sort of entity
    [/quote]

Similar Threads

  1. php script won't work inside "cgi-local" directory
    By Volitics in forum PHP Development
    Replies: 5
    Last Post: April 26th, 2004, 11:50 PM
  2. Replies: 4
    Last Post: February 22nd, 2004, 06:09 PM
  3. Replies: 2
    Last Post: February 11th, 2004, 12:03 AM
  4. Trying to call cgi script onunload via image.src
    By oscarf in forum HTML Programming
    Replies: 3
    Last Post: February 6th, 2004, 11:18 PM
  5. How can I enable a power user to run this script?
    By Yamadatroy in forum Visual Basic Programming
    Replies: 2
    Last Post: January 19th, 2004, 10:39 PM

IMN logo majestic logo threadwatch logo seochat tools logo