1

I have the following HTTP data:

POST /forum/post.php HTTP/1.1
Accept: text/xml, text/html, text/plain, */*
Host: myhost.com
Content-Length: 752
Cache-Control: no-cache

LxINAXyIgvOZQBF28yt0/NYmrYy7/dWENDNdFybIqYSWxLS6Ystk1pHfFDEBOJPgfJMWPQwqojMTvLugMOD7ZeXm33WYxFnjhR8C+Q8es49bGp8GiBmU7o3VYvJYKHSsknRXoB9tp9hhnzBJ4RMOhLbIIk5i6QwR8sFHxqUsL+i/8mKJDAcDsXXZcJXlXqhRN7fCDqLb/vTmnSTm+qA2HWU1AsBAGpWoQycRr0BT62lI2H3WnKevGi7fePJdCKWmwp5yoztKYCI3QJKrJbt5f60zb8TR5JHEs2S8ne0e6mssV7N4A3rwE+/O08pfHAmsVVtotpdqkPHWEWr+S7te9r01grfJt6GY0ozH0BPqSkP98wUwlrD385sRzf8M8uOw3hI1DWliZl0ea2Dc4b/7zVfwsqHl94Hk5x2p6nzXaW0vEsAVrodNIIcv3ZGGEkk97BOsHXP1rvJNiQLuM/7D3X9WFX/cYYqnNrIW84rhtbhty04r6JH37G9hPDlHjiYAogQ0lpMubsTNaW35Gn9G7X/qaH4+uQtYDVt67graNB3dDEBQRfXHw/sOM57hlxU/o/Q52RgAcekhGABXsLtXH3Sd5rurYg+qjMtceK9hC37ylXOJ+0bTKVf/A8nLlMarTtGhQK+oG8Rx8juy/USlCvg4++dCXS3qr0pFC9u2tcLAgND0g3tcBN1kYw2Ca4TTxP5m932pBTict7PE0jAXITmOoV3MGFE9AsKMJAVUdRK0sg==

How can I capture the BASE64 data and write it to a file, I tried to dump the $_POST variables but I get nothing, tried with $_REQUEST or serialize($_REQUEST) and all I get is:

Array
(
)

How can I capture an undefined post data? Thanks!

2
  • 1
    Possible duplicate of stackoverflow.com/questions/3362145/…? Commented Dec 10, 2012 at 9:38
  • PHP only decodes URL encoded POST data into $_POST. For data of any other format, see ^ Commented Dec 10, 2012 at 9:39

1 Answer 1

3

It can be found in $HTTP_RAW_POST_DATA:

echo $HTTP_RAW_POST_DATA;

Or:

echo file_get_contents("php://input");

Manual.

You can then write it to a file with file_put_contents() or any of the other methods to write to a file.

Sign up to request clarification or add additional context in comments.

1 Comment

MrCode, both methods work, thank you! Still waiting for stackoverflow to let me accept answer :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.