RE: [PHP] How to pass params in URL without ? or &?

From: Date: Wed, 29 Nov 2000 21:40:03 +0000
Subject: RE: [PHP] How to pass params in URL without ? or &?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27890@lists.php.net to get a copy of this message
At 02:21 PM 11/29/00 -0700, Jason Cox wrote: >Rasmus gave a solution to this question a couple of weeks ago and I just >happen to still have his email: OK - thanks for the quick response, but my problem is that THIS solution is precisely the solution I haven't been able to get to work. > http://www.foo.bar/some/path/script.php/arg1/arg2 > >$PATH_INFO will contain "/arg1/arg2" Per my message, script.php is NOT being called in my environment when I use that URL. >You can also add something like this to your httpd.conf file: > > <Location "/some/path/script"> > ForceType application/x-httpd-php > </Location> > >And then you can make your URL look like this: > > http://www.foo.bar/some/path/script/arg1/arg2 Per my message, I have tried this as well. It is not completely clear what the SCRIPT name is supposed to be in this case, but one document said I should name it "script" and place it in "/some/path". This has failed to cause "script" to be called. Again, does anyone know if these solutions are intended for PHP as an Apache module only, or are they supposed to work with PHP as a CGI? Thanks. I'm going to throw a party if and when somebody can solve this one. - Ken kenzo (at) free-music.com >-----Original Message----- >From: Ken [mailto:kenzo@free-music.com] >Sent: Wednesday, November 29, 2000 1:56 PM >To: php-general@lists.php.net >Subject: [PHP] How to pass params in URL without ? or &? > > >Surely SOMEBODY has dealt with this issue before. To reiterate, I want to >have a URL like: > >http://mysite.com/script.php3/p/value/p2/value2/ > >and have it call my script "script.php3" and pass it parameters p and p2, >with values value and value2. > >I know how to parse "/p/value/p2/value2/" within my script to achieve that >result, but I can't figure out how to configure my Apache or PHP3 to even >call "script.php3" when given a URL like the above. > >I'm stuck. The only thing I can think of is that it might not be doable >when running PHP as a CGI instead of running PHP as an Apache module. > >Can anyone solve this one? > >Thanks greatly. Original message is below. > >- Ken >kenzo (at) free-music.com > > >Date: Tue, 28 Nov 2000 06:01:05 -0500 > >To: php-general@lists.php.net > >From: Ken <kenzo@free-music.com> > >Subject: [PHP] Using http://mysite.com/script.php3/p/value > >to pass value, >PHP CGI > > > >I'm trying to make PHP scripts that have search-engine-friendly URL's (like >http://mysite.com/script.php3/p/value). I'll be passing >parameters around >in the URL's, but I don't want to use & and ?, since this will prevent >search engines from indexing the site. > > > >I'm using PHP 3.0.16 (currently under Win32, so it's a CGI, not an Apache >module) and Apache 1.3.12. > > > >I've encountered various help documents that talk about how to parse the >/p/value part of the URI. I found one document that instructed me to use >ForceType in my Apache conf to get all calls to folder "script" to call a >PHP file called "script" in my docroot, and then have it parse the /p/value. > > > >I have had no luck in getting PHP/Apache to even get as far as opening my >script. I haven't yet tried to deal with parsing issues, as this is still >moot. > > > >In access.conf, I have: > ><Location /local> > >ForceType application/x-httpd-php3 > ></Location> > > > >In my web root, I have a file called "local". > > > >Trying to access the URL http://localhost/local yields: > > > >Fatal error: Unable to open d:\mydocroot\local\ in - on line 0 > > > >as returned from my PHP process. So, PHP is being called, but it's not >winding up opening the file I want it to open. > > > >If I rename my file to "local.php3", just as an experiment, and I still use >the same URL as above, the error message changes to: > > > >Fatal error: Unable to open d:\mydocroot\local.php3\ in - on line 0 > > > >Can this even be done when running PHP as a CGI? > > > >As a side question, can PHP3 be run as an Apache module? I haven't found >the binaries for this anywhere. > > > >Thanks greatly for any help. I have combed many resources trying to get an >answer to this question. > > > >- Ken > >kenzo(at)free-music.com

« previous php.general (#27890) next »