Jump to content

Automatic Printing of New Records


This topic is 7307 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

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

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

This topic is 7307 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.