Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capture RAW (non decoded) $_GET data in PHP

Tags:

php

get

capture

I am running some tests to understand subtle nuances between various browsers / OSs and how they send data via different methods, ajax, stand posts & get, jQuery, etc. so I need to capture data as it comes through to the server, unaltered.

I have a PHP script that is capturing RAW POST data using php://input, but I'm unclear on how to achieve a similar stream for data sent via GET. The $_GET array url decodes my data, which for this sets of tests I do not want. I want the RAW URL encoded data as sent to in the GET request.

Is there a quick way to do this in PHP?

Thanks!

like image 476
Cyph Avatar asked Jun 24 '13 17:06

Cyph


1 Answers

You could use the $_SERVER['QUERY_STRING'] value and parse that.

like image 156
Matthew FitzGerald-Chamberlain Avatar answered Nov 03 '22 01:11

Matthew FitzGerald-Chamberlain