Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Get .PHP Filename?

    I've been looking thru my PHP functions and can't find what I need -
    is there a function that will tell me what .php file is currently
    executing?

    Thanks...

    Ralph Freshour Guest

  2. Similar Questions and Discussions

    1. Exporting Changes my filename
      Sometimes when I go to export a pdf the filename has somehow changed to a new file name. It doesn't happen all the time only sometimes
    2. split filename
      who can split this file name then subtract "kenny.pdf" file name--> C:\programfiles\funk\pdf\kenny.pdf
    3. Getting only the filename ??
      I'm creating a player that allows you to have multiple files stacked and play anyone of them. The problem now is i need to get only the filename out...
    4. Opening the same filename
      On my computer, (Windows XP FMP 5.5 & FMD 6) I can open two files with the exact same name that are stored in different directories. On my friend's...
    5. PC to Mac jpg Filename Problem
      I'm using PS 7.0.1 on XP Pro, and whenever I save a jpg file and burn it to disc, the filenames dislay completely different on a Mac. For example,...
  3. #2

    Default Re: Get .PHP Filename?

    Ralph Freshour <ralph@primemail.com> wrote in
    news:21rvlvo3crema1kiontqaklkl8len3230r@4ax.com:
    > I've been looking thru my PHP functions and can't find what I need -
    > is there a function that will tell me what .php file is currently
    > executing?
    >
    $_GET['SCRIPT_NAME'] will give you the current path, without any GET data.
    I think.

    $_GET['REQUEST_URI'] will give you the full URI, including any GET data.

    --
    Larry Flynt for Governor!
    Bringing dignity back to the Governor's Mansion

    Terry Austin
    [email]taustin@hyperbooks.com[/email]
    [url]http://www.hyperbooks.com/[/url]
    Terry Austin Guest

  4. #3

    Default Re: Get .PHP Filename?


    "Ralph Freshour" <ralph@primemail.com> wrote in message
    news:21rvlvo3crema1kiontqaklkl8len3230r@4ax.com...
    > I've been looking thru my PHP functions and can't find what I need -
    > is there a function that will tell me what .php file is currently
    > executing?
    >
    > Thanks...
    >
    $_SERVER['PHP_SELF'] is just one of a number that could tell you what you
    want... A whole host of other interesting values are available if you just
    call phpinfo(); and check the output (which is in a nice clean table). Note
    though that some variables are sent by the client (browser) and not all
    clients (browsers) send the same amount of data (ie some reveal more
    information, others don't - and some (like me) who have Norton Internet
    Security 2003 have some of the headers sent by the client removed before
    they hit the server (meaning minimum amount of data).

    But if its just findiing out about server side values, then you should/can
    rely on phpinfo(); to help you out.


    Randell D. Guest

  5. #4

    Default Re: Get .PHP Filename?


    "Ralph Freshour" wrote: I've been looking thru my PHP functions and can't
    find what I need -
    > is there a function that will tell me what .php file is currently
    > executing?
    $_SERVER['PHP_SELF'] is the 'parent' script you are executing. If you
    include several files into it, $_SERVER['PHP_SELF'] would still be the
    same.
    If you need the filename of included files into themselfs, use __FILE__.


    Rainer Erismann Guest

  6. #5

    Default Re: Get .PHP Filename?

    Ralph Freshour <ralph@primemail.com> schrieb:
    > I've been looking thru my PHP functions and can't find what I need -
    > is there a function that will tell me what .php file is currently
    > executing?
    Use the function phpinfo() and have a look at all those variables at the
    end of the page. You might get some more ideas about your task. :-)

    Matthias
    Matthias Esken Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139