I would like to have the the result of an HTML form POST call into the content of another PHP file. The goal is to have a redirection page generated dynamically based on the HTML form values.
$redirectionLink = $_POST["redirectionLink"];
$redirectionFileContent =
`
<?php
header("Location:.".'$redirectionLink ');
?>
`;
$otherFileLocation= 'c:\xampp\htdocs\li\something.php';
file_put_contents($otherFileLocation,$redirectionFileContent);
I receive the following output when I run the code above:
Notice: Array to string conversion in C:\xampp\htdocs\shortlink\process.php on line 25
I don't know how it would be better. Maybe store it in a variable or write into it as a post call
I'm open to suggestions.
Thank you for your help in advance.