apache content negotiation and $_GET

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....


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-13-2007
Per Jessen
 
Posts: n/a
Default apache content negotiation and $_GET

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
Reply With Quote
  #2 (permalink)  
Old 08-13-2007
Per Jessen
 
Posts: n/a
Default Re: apache content negotiation and $_GET

Per Jessen wrote:

> All,
>
> I've got a weird issue concerning $_GET and apaches content
> negotiation.


I should have mentioned I'm using php 5.2.0 and apache 2.2.3.


/Per Jessen, Zurich
Reply With Quote
  #3 (permalink)  
Old 08-13-2007
Tijnema
 
Posts: n/a
Default Re: [PHP] apache content negotiation and $_GET

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
Reply With Quote
  #4 (permalink)  
Old 08-13-2007
\Crash\ Dummy
 
Posts: n/a
Default Re: apache content negotiation and $_GET

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


Reply With Quote
  #5 (permalink)  
Old 08-13-2007
Per Jessen
 
Posts: n/a
Default Re: [PHP] apache content negotiation and $_GET

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
Reply With Quote
  #6 (permalink)  
Old 08-13-2007
Stut
 
Posts: n/a
Default Re: [PHP] apache content negotiation and $_GET

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/
Reply With Quote
  #7 (permalink)  
Old 08-13-2007
Richard Lynch
 
Posts: n/a
Default Re: [PHP] apache content negotiation and $_GET

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?
Reply With Quote
  #8 (permalink)  
Old 08-14-2007
Per Jessen
 
Posts: n/a
Default Re: [PHP] apache content negotiation and $_GET

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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:06 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0