Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi everyone,

I'm having a problem running scripts from php. One of many things may be happening but I'm not very familiar with the api. What I'm trying to do is run a script that will create a pdf and put it in a temporary location in my web directory. I know the script works perfect using the Filemaker Client but I am unable to call it from php. I've tried both ways below:

$params = 2;

$conn = new FileMaker(......);





$test = $conn->newPerformScriptCommand('layout','some_Script',$params);

$result=$test->execute();



/*

$cmd = $fm->newFindAnyCommand('layout');

$cmd->setScript('some_Script',$params);

$blah=$cmd->execute();

*/

Unfortunately no matter how it's written it always comes up with the same error and won't run the script. I've tested this with a simple script as well that finds and changes the value of a known record field. nothing seems to work. It always comes to the error shown below.

Notice: Only variable references should be returned by reference in /Library/FileMaker Server/Web Publishing/publishing-engine/php/lib/php/FileMaker/Command.php on line 126

If anyone has gotten scripts to work with php please let me know what i'm doing wrong.

OS Mac OSX

Filemaker 9 server

Thanks in advance,

Afrite

Posted (edited)

Hi Afrite,

Unfortunately, CWP only supports scripts that are web compatible. If your script has any steps in it that aren't web compatible then your script will fail. If you tick the little box down the bottom left corner of script maker it will gray out incompatible steps. Save as PDF is unfortunately not a compatible step...

If you add:

echo $result->getMessage();

You'll see your error.

Edited by Guest
  • 1 month later...
Posted

You can use PHP to create a pdf. It's pretty incredible what it can do. Basically you call a function to create a blank pdf, then you start sending text and graphics to it, each time telling it the x/y coordinates to start.

Should be able to find lots of guidance on the web if you search for php create pdf

or here at php.net: http://ca3.php.net/manual/en/ref.pdf.php

This topic is 6263 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.