This is a discussion on apache content negotiation and $_GET within the PHP General forums, part of the PHP Programming Forums category; All, I've got a weird issue concerning $_GET and apaches content negotiation. situation one: files in htdocs/: phpinfo.phtml....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
All,
I've got a weird issue concerning $_GET and apaches content negotiation. situation one: files in htdocs/: phpinfo.phtml.en (all it does is call phpinfo()). phpinfo.html - apache type-map if I load URL = https://server/phpinfo?klop=99, I see no _GET variables listed. (with the URL, apache will pick the phpinfo.html file, treat it as a type-map and load phpinfo.phtml.en) if instead I skip the content negotation, and use URL = https://server/phpinfo.phtml.en?klop=99, the $_GET variable is available. Any suggestions? thanks, Per Jessen, Zurich |
|
|||
|
On 8/13/07, Per Jessen <per@computer.org> wrote:
> All, > > I've got a weird issue concerning $_GET and apaches content negotiation. > > situation one: > > files in htdocs/: > > phpinfo.phtml.en (all it does is call phpinfo()). > phpinfo.html - apache type-map > > if I load URL = https://server/phpinfo?klop=99, I see no _GET variables > listed. (with the URL, apache will pick the phpinfo.html file, treat > it as a type-map and load phpinfo.phtml.en) > > if instead I skip the content negotation, and use URL = > https://server/phpinfo.phtml.en?klop=99, the $_GET variable is > available. > > Any suggestions? > > > thanks, > Per Jessen, Zurich This has nothing to do with PHP, and there's only a very little chance you get a successfull result here. Your Apache type-map probably just doesn't take the $_GET variables with it, but don't ask me how to fix ;) I can provide a PHP solution for it ;) Tijnema -- Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info |
|
|||
|
Since I don't have either of those files in my Apache/htdocs directory, I assume
it is a Linux thing. I have Apache and PHP installed in Windows, and the way I see the PHP information is with a file named phpinfo.php. It contains a single line: <?PHP phpinfo(); ?> If I call it with a query string, http://domain/path/phpinfo.php?var=data, The _GET["var"] parameter shows up under "PHP Variables." -- Crash Running: Windows 2000 Pro - Apache 2.2.4 - PHP 5.2.1 - PERL 5.8.8 |
|
|||
|
Tijnema wrote:
> This has nothing to do with PHP, and there's only a very little chance > you get a successfull result here. > Your Apache type-map probably just doesn't take the $_GET variables > with it, Yeah, that is possible - I was wondering whether to blaim PHP or Apache. I just thought there was litte risk of apache throwing away the querystring during content-negotiation. I can tell that the $_SERVER[query-string] variable is not set when using the type-map, but it when I go straight to a specific file. That does seem to suggest apache is at fault. /Per |
|
|||
|
Per Jessen wrote:
> Tijnema wrote: > >> This has nothing to do with PHP, and there's only a very little chance >> you get a successfull result here. >> Your Apache type-map probably just doesn't take the $_GET variables >> with it, > > Yeah, that is possible - I was wondering whether to blaim PHP or Apache. > I just thought there was litte risk of apache throwing away the > querystring during content-negotiation. > > I can tell that the $_SERVER[query-string] variable is not set when > using the type-map, but it when I go straight to a specific file. That > does seem to suggest apache is at fault. Actually it suggests exactly that. Apache is giving PHP the query string, and PHP does nothing to it before it puts it in the $_SERVER variable. So this basically means that when you use the type-map Apache is not populating the query string variable. In short, I'm 5-9's% certain it's Apache that's throwing it away. -Stut -- http://stut.net/ |
|
|||
|
On Mon, August 13, 2007 4:45 am, Per Jessen wrote:
> I've got a weird issue concerning $_GET and apaches content > negotiation. > > situation one: > > files in htdocs/: > > phpinfo.phtml.en (all it does is call phpinfo()). > phpinfo.html - apache type-map > > if I load URL = https://server/phpinfo?klop=99, I see no _GET > variables > listed. (with the URL, apache will pick the phpinfo.html file, treat > it as a type-map and load phpinfo.phtml.en) > > if instead I skip the content negotation, and use URL = > https://server/phpinfo.phtml.en?klop=99, the $_GET variable is > available. > > Any suggestions? PHP pretty much just blindly passes on whatever is in the REQUEST_URI into $_GET. So the GET data isn't surviving the type-map forwarding. So your question boils down to: Why isn't Apache's type-map propagating the GET arguments? This question has no PHP in it; You'll probably find the answer faster/better in an Apache milieu. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? |
|
|||
|
Stut wrote:
> Actually it suggests exactly that. Apache is giving PHP the query > string, and PHP does nothing to it before it puts it in the $_SERVER > variable. So this basically means that when you use the type-map > Apache is not populating the query string variable. > > In short, I'm 5-9's% certain it's Apache that's throwing it away. FYI - http://issues.apache.org/bugzilla/show_bug.cgi?id=33112 /Per |
![]() |
| Thread Tools | |
| Display Modes | |
|
|