I have a scenario where I want to pass a value AND redirect from the authentication.php
file to index.php
file without using GET but only POST. I want to keep it hidden from the user.
I thought about using cURL but as far as I know this will execute the index.php
file, right?
// set post fields
$post = [
'customer' => 'username',
'token' => 'token123'
];
$ch = curl_init('www.domain.com/index.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
// execute!
$response = curl_exec($ch);
// close the connection, release resources used
curl_close($ch);
PS: I dont want to use SESSION nor COOKIES. I understand that COOKIES can be encrypted but I still dont prefer to use them.
So, is there a good way for doing this?
source https://stackoverflow.com/questions/68581273/how-to-pass-a-value-with-post-from-a-php-file-to-another-one
Comments
Post a Comment