Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP: write in php://input

I would like to know how I could write something in "php://input".

Actually I would like to know if I can use this stream like a superglobal.

Example with $_POST

file1: $_POST['param'] = "test";

file2: $param = $_POST['param'];

What I want

file1: ?????????????

file2: $param = file_get_contents('php://input');

Do I need to throw a POST request to from file1 to file2?

Thanks for read me :)

Have a nice day

Michaël S.

like image 344
Michaël Avatar asked May 16 '26 08:05

Michaël


1 Answers

php://input is a read-only stream that allows you to read raw data from the request body. (PHP docs)

Maybe, you will find unix-sockets, or shared memory useful?

like image 85
SlyChan Avatar answered May 18 '26 21:05

SlyChan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!