I have successfully setup an HTML form in PHP File #1, and it is successfully posting the form data to PHP File #2. Now what I'm trying to do is take the posted data from PHP File #2 and store it as a variable in a new file, called PHP File #3. In this situation, the user will be submitting a search string through an input field, and all I want to do is use that information to be stored as a variable for later use in an external PHP file.
So let's say the user submits "John Smith" through the input field. Right now, "John Smith" will get posted to PHP File #2 (it's also turned into a variable there, called '$query'. So then I simply want to create the same variable in a 3rd PHP File (also called '$query') and have the contents from the form be stored in it. But since it's from an external source I don't know the exact syntax on how to do this.
If someone could just show a generic example of this for pulling the info from the 2nd PHP file, that would be the most helpful. I'm pretty sure we would use file_get_contents, but I don't understand how to pull a specific piece of info from a variable in the 2nd PHP file.