[PHP] filename into variable.

2001-04-04 Thread Michael Roark
How would i go about building a page which could use the name of the page less .php as a variable. For example: Say I have a file called screenshot_1.php and another called screenshot_2.php . Inside each of those files I want to have code which will take the name of the file from the url and

Re: [PHP] filename into variable.

2001-04-04 Thread Joe Stump
Something like this would work ... let's say your path is http://www.server.com/images/screenshot_1.php ? $junk = explode('/',$REQUEST_URI); list(,,$file) = $junk; list($picture) = explode('.',$file); ? That should do it just fine I might be off on my commas On Wed, Apr 04, 2001

Re: [PHP] filename into variable.

2001-04-04 Thread Morgan Curley
try: ?php preg_match( "/([^\/]+)\.php/", $HTTP_SERVER_VARS['PHP_SELF'], $matches ); echo "H2$matches[1]/H2"; ? Morgan At 01:26 PM 4/4/2001, you wrote: How would i go about building a page which could use the name of the page less .php as a variable. For example: Say I have