March 25, 200421 yr Hello, I am working with a PHP application that submits forms to Fielmaker. Is there a way for every new form or record to be automatically printed as soon as they are submitted? Thanks
March 25, 200421 yr One method is by running an FM Script. (This is if you want to print from an FM Layout.) Here is a php script which "run" an FM Script: <?php $result = file_get_contents("http://localhost:591/FMPro?-db=combotest.fp5&-format=-fmp_xml&name=owen&-script=test&-find"); if ($result==0) { echo "Yahoo!!!";} else { echo "Not OK";}; ?> All the best. Garry
March 25, 200421 yr Garry, By printing I meant sending the just created record to the printer and automatically printing it out. Thanks. P.S. I'm using the FX module to connect to FM.
March 26, 200421 yr I do not use FX, however here is a PHP method which calls a Script: $args = ""; while ($fm_params = Current($_REQUEST)) { $args .= urlencode(key($_REQUEST)) . "=" . urlencode($fm_params) . "&"; next($_REQUEST); }; @include("http://localhost:591/FMPro?" . $args); ?> You could use a Form like this: <body> Hello World<br> <form action="fmpro.php" method="POST"> <input type="hidden" name="-db" value="combotest.fp5"> <input type="hidden" name="-format" value="-fmp_xml"> <input type="hidden" name="-script" value="printrec"> fields go here....... <input type="submit" name="-new" value="New Rec"> </form></body> Good Luck with the FX version. Garry
Create an account or sign in to comment