The form data sent to the server isn't in the $_REQUEST variable, it's passed through the stdin connector. Try
$data = file_get_contents("php://input");
I don't understand this. I know file get contents get the contents of file, but I don't understand the "php://input". Why does it work in Acrobat and why does the request work when I have told the form to submit field data a GET? I tried pasting the code into my php file and I get nothing when sent from Acrobat.
With Reader I believe you have to return FDF data. Reader has no clue what to do with the text contents you return from your PHP, because it does not contain the "convert to PDF" code found in Acrobat.
"With Reader I believe you have to return FDF data. Reader has no clue what to do with the text contents you return from your PHP, because it does not contain the "convert to PDF" code found in Acrobat."
I do not want to return any data to Reader. I just want to send data from Reader to be email and stored.
Isn't the purpose of die(print_r($_REQUEST)) to send information back to the client? Sorry, if not, then I misunderstood.If it is, then you are returning text contents to Reader - aren't you?
Can you give us the whole of a set of data submitted by Reader (remove anything confidential of course). There are no cookies in Reader, either...
This is an array of the data being sent
var aSubmitFields = Array('acceptcode','SALES PERSON','DATE','Job Number','Job Description','Business Name','Contact Name','Proof Status','CHANGES COMMENTS','PROOFED OK BY','Okay Date','Phone Numbers','Spelling','Names_A_Addresses','Layout_A_Size','Ink_Colors','Bleeds_A_Margins',' Folds_A_Prefs','Photo_Resolution')
I have the die(print_r($_REQUEST)) just to see if the data gets to the php script. When I do this in Acrobat, Acrobat creates a nice PDF of the php web page. When I do this with Reader it send the request, but then it creates an html file in the temp folder with the data. But the data that was supposedly sent is not displayed in the html file nor is it place in the database. Just cookie information for the domain that the php file site on.
I would expect Reader to fail horribly if you try this. By design because you are not sending it an FDF, and you have to send it an FDF (or nothing). There's no guarantee it will save anything, nor that what it saves is what it was sent, or anything useful. Since Reader does not know anything about cookies, and does not send them, the chances are that the HTML you see is a side effect of something you weren't asking for.
If you want to track what Reader is sending, log it or save it on the server.
If you want to track what Reader is sending, log it or save it on the server
Yes, but how? That is what I am trying to do.
I don't know PHP, but you need to not use methods that show anything in the browser there and then. Whatever method you use would write a file, or more than one file, which you'd have a DIFFERENT PHP to display later on. Or it would send an email or whatever. The call you are using is not suitable.
Sorry, I didn't notice your bGet parameter; but that's why it won't work in Reader.
As the SDK explains, to use bGet:true you need the Acrobat Web Capture plugin to be loaded, which as the name suggests isn't available in Reader. To submit HTML in Reader you have to use POST, in which case the returned data is available in $_REQUEST (as an alias for $_POST) and on the standard input (php://input).
As Test Screen Name says, while you can submit the form data to the server in HTML using Reader, the server has to respond in FDF. Here's a sample utility script that will dump all the data to a logfile and reply with something in a dialog box:
$data .= "--- STDIN follows ---\n".file_get_contents("php://input");
$data .= "\n --- REQUEST follows ---\n";
foreach ($_REQUEST as $k=>$v) $data .= "$k = $v\n";
$data .= "\n === END DATA ===";
$log = fopen("datalog.txt","w");
fwrite($log, $data, strlen($data));
// reply with some FDF data
1 0 obj
<< /FDF <<
/Status (Thanks - your information has been stored)
<< /Root 1 0 R >>