zhenyasj Posted March 25, 2004 Share Posted March 25, 2004 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 Link to comment Share on other sites More sharing options...
Garry Claridge Posted March 25, 2004 Share Posted March 25, 2004 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 Link to comment Share on other sites More sharing options...
Guest Posted March 25, 2004 Share Posted March 25, 2004 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. Link to comment Share on other sites More sharing options...
Garry Claridge Posted March 26, 2004 Share Posted March 26, 2004 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 Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7474 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now