So I have been looking online for several hours for what I think is a very simple answer but I can't seem to find it.
I am trying to understand how PDF form data submitting works. My goal is to read form data submitted from a PDF form that I set up into my PHP script. I want my PHP script to parse the form data and plug it into my SQL database.
The roadblock I am running into is how do I receive the file so I can parse it?
What is the filename of the file that gets submitted?
I have my submit button setup on my PDF form and I can export it in FDF, HTML, or XFDF, but I am just trying to get the data into a string or get the contents somehow into PHP but I don't know how.
If I try:
$fileFromPDF = file_get_contents('file.txt', true);
I still need the name of a file, and I don't know the name of the file that is being submitted from the PDF form. How do I get the name of this file? Is it even a file or just a line of xml? If it is just a line of XML, how do I receive this?
Any help would be appreciated or if someone could point me in the right direction.
I think I finally found out the answer to this. I used this code:
and I was able to get a string.
If anyone knows a better way, I am all ears. Thank you!