By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,615 Members | 1,961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,615 IT Pros & Developers. It's quick & easy.

PHP and sub-path parameters ?

P: n/a
When I used to write ISAPI DLLs, I could create a web app XYZ.DLL and
call it like this:

http://www.xyz.com/cgi-bin/xyz.dll/o...suboption2?x=4
(real example http://www.craznar.com/cgi-bin/cz.dll/freestuff )

Is there any way to achieve this with PHP ?

e.g.

http://www.xyz.com/cgi-bin/xyz.php/o...suboption2?x=4

Such that I would have something like:

$_GET['path'] = '/option1/suboption2'
$_GET['x'] = 4;

Can I do this:
http://www.xyz.com/cgi-bin/xyz.php?o...suboption2&x=4

or do I explicitly have to

http://www.xyz.com/cgi-bin/xyz.php?p...suboption2&x=4


--
Spam:newsgroup(at)cr*********@verisign-sux-klj.com
EMail:<0110001100101110011000100111010101110010011 010110
11001010100000001100011011100100110000101111010011 011100
11000010111001000101110011000110110111101101101001 00000>
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
127.0.0.1 wrote:
When I used to write ISAPI DLLs, I could create a web app XYZ.DLL and
call it like this:

http://www.xyz.com/cgi-bin/xyz.dll/o...suboption2?x=4
(real example http://www.craznar.com/cgi-bin/cz.dll/freestuff )

Is there any way to achieve this with PHP ?

e.g.

http://www.xyz.com/cgi-bin/xyz.php/o...suboption2?x=4

Such that I would have something like:

$_GET['path'] = '/option1/suboption2'
$_GET['x'] = 4;

Can I do this:
http://www.xyz.com/cgi-bin/xyz.php?o...suboption2&x=4

or do I explicitly have to

http://www.xyz.com/cgi-bin/xyz.php?p...suboption2&x=4


Afaik it isn't possible in PHP... but if you use Apache as your
webserver, you could try:
http://httpd.apache.org/docs/mod/mod_rewrite.html

Regards,
Johan

Jul 17 '05 #2

P: n/a
Hi,

127.0.0.1 wrote:
When I used to write ISAPI DLLs, I could create a web app XYZ.DLL and
call it like this:

http://www.xyz.com/cgi-bin/xyz.dll/o...suboption2?x=4
(real example http://www.craznar.com/cgi-bin/cz.dll/freestuff )

Is there any way to achieve this with PHP ?

e.g.

http://www.xyz.com/cgi-bin/xyz.php/o...suboption2?x=4

Such that I would have something like:

$_GET['path'] = '/option1/suboption2'
$_GET['x'] = 4;

Can I do this:
http://www.xyz.com/cgi-bin/xyz.php?o...suboption2&x=4

or do I explicitly have to

http://www.xyz.com/cgi-bin/xyz.php?p...suboption2&x=4


It seems that if PHP is an Apache module (and possible modules for other
servers) you can say:

http://www.xyz.com/cgi-bin/xyz.dll/o...suboption2?x=4

But it doesn't work with PHP as a CGI as the server gets confused about
what to run.

You can have any data you like after the ? if you don't mind parsing it
yourself (see $_SERVER["QUERY_STRING"]), so option 2 is open, and as you
say your final suggestion works too.

So I'd say that's all of them :-) Take your pic.

Regards,

Luke

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.