Re: Apache 2.0.52 / PHP 4.3.10 Integration Question...

From: Date: Sat, 01 Jan 2005 03:51:00 +0000
Subject: Re: Apache 2.0.52 / PHP 4.3.10 Integration Question...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-205446@lists.php.net to get a copy of this message
* Robin Getz <rgetz@blackfin.uclinux.org>: > I have a file named /www/projects which is a php script. > When I type the url: www.site/projects/variable > > I want variable passed to the script "projects" > > I have the the http.conf set up as: > > <Files projects> > SetInputFilter PHP > SetOutputFilter PHP > AcceptPathInfo On > </Files> > > Which used to work with apache 2.0.40 and php 4.2.3 - but what happens now, > is I actually get passed the php script back as text to the browser. > > Any thoughts? Yes... approach it differently. Try the following: In httpd.conf or your .htaccess, have: <Files projects> ForceType application/x-httpd-php </Files> Then, in your projects file, use the PATH_INFO key from $_SERVER to access variables passed as part of the 'url' (anything following a slash trailing the word 'projects' in the url): $path_info = $_SERVER['PATH_INFO']; $path_info = substr($path_info, 1); // Trim off first slash $args = expode('/', $path_info); $variable = $args[0]; -- Matthew Weier O'Phinney | mailto:matthew@garden.org Webmaster and IT Specialist | http://www.garden.org National Gardening Association | http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org

« previous php.general (#205446) next »