Results 1 to 5 of 5
October 21st, 2005, 11:06 PM #1PHP file name help
I used to run this at my old web host and it works:
On the new server, it won't return the page that the users is looking at. I get this:
I think the new web host has set up PHP differently that my old one. At the new place, I can actually edit my own php.ini file (inside the cgi-bin) so others on the same sever won't be affected by my changes.
Does anyone know how I can grab the filename / page (ie. /index.html) that the code is running on?
October 21st, 2005, 11:23 PM #2
From PHP.Net (available @ http://php.net/reserved.variables)
The filename of the currently executing script, relative to the document root. For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar would be /test.php/foo.bar. The __FILE__ constant contains the full path and filename of the current (i.e. included) file.
The URI which was given in order to access this page; for instance, '/index.html'.
October 22nd, 2005, 12:05 AM #3
Fantastic Rogi. Now why couldn't me new web host just tell me that. They both work falwlessy! Thanks!
October 22nd, 2005, 12:16 AM #4
October 27th, 2005, 07:15 PM #5Originally Posted by Affiliate Ian
You can run your own php.ini changes just about anywhere:
See also http://us3.php.net/manual/en/configuration.changes.php
By teezone in forum Programming / Datafeeds / ToolsReplies: 8Last Post: September 4th, 2009, 03:54 PM
By Abtek in forum PopShopsReplies: 0Last Post: April 24th, 2009, 08:31 AM
By Uncle Rico in forum Programming / Datafeeds / ToolsReplies: 7Last Post: January 19th, 2009, 12:11 PM
By randomtexture in forum GoldenCANReplies: 2Last Post: December 31st, 2008, 11:04 PM
By dak142 in forum Programming / Datafeeds / ToolsReplies: 8Last Post: April 2nd, 2004, 05:24 AM