Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I'm trying to use PHPlot from SourceForge ( http://sourceforge.net/projects/phplot ) and I try to create a simple plot with this code:


require_once 'phplot/phplot.php';



$plot =& new PHPlot();



// Uncomment this line to send output to top level of your hard disk (at least on MacOS X)

//$plot->SetOutputFile('mygraph.png');



$plot->SetIsInline(true);

$data = array(array('', 0, 0), array('', 1, 9));

$plot->SetDataValues($data);

$plot->SetDataType('data-data');

$plot->DrawGraph();

When executed, the output from SmartPill is only 8 bytes long - basically the first 8 bytes of the PNG image that should be outputted. If I uncomment the call to SetOutputFile the graph is written to the mygraph.png file perfectly. So, is this a bug in SmartPill or am I missing something obvious?

Also, calls to Header() don't work with SmartPill - is this a known limitation?

It sounds like you're trying to set the contents of a container field? If so, this isn't supported, instead you have to write the file to disk and then import it. You can then delete it if you like or we sometimes just use a name like temp and overwrite it each time. We're looking into adding support for writing to containers in the next version.

In regards to the header() function, what are you trying to achieve?

  • Author

Boiling it all down, PHPlot generates a PNG/JPG/GIF image of a chart, and yes, my ultimate desire was to put the resulting image into a FileMaker container field. So I guess what you're saying is the call to ImagePng(), ImageJPEG(), ImageGIF(), and others just don't work if you try to send the output to PHP's default output device?

As I discovered that you can write to a file OK and as you suggested, that's the work around I'll use. Not a big deal.

Sorry for my confusion here - I was just assuming that basically 'any' PHP code was going to work. Is there a list of what is (or isn't) supported or at least areas of PHP functionality we should stay clear of?

I asked about Header() because PHPlot was using them, and I noticed that not even that data was being outputted. I'll grant you that not having Header() work isn't a big deal, but it goes back to my question above about knowing what is/isn't supported with SmartPill.

Please don't get me wrong - I think SmartPill is a great tool and I look forward to using it 'for real'.

> Boiling it all down, PHPlot generates a PNG/JPG/GIF image of a chart, and

> yes, my ultimate desire was to put the resulting image into a FileMaker

> container field. So I guess what you're saying is the call to ImagePng(),

> ImageJPEG(), ImageGIF(), and others just don't work if you try to send the

> output to PHP's default output device?

We need to provide a special function in order to write to a container field. The issue has to do with FileMaker's plug-in API which requires special handling when dealing with container fields.

> As I discovered that you can write to a file OK and as you suggested, that's

> the work around I'll use. Not a big deal.

>

> Sorry for my confusion here - I was just assuming that basically 'any' PHP

> code was going to work. Is there a list of what is (or isn't) supported or

> at least areas of PHP functionality we should stay clear of?

You always have to check for extension support, although we support quite a few; use print_r(get_loaded_extensions()); to see the list. I don't know if you've used the PHP CLI (command line interface) but using SmartPill is very similar. You can visit http://us3.php.net/features.commandline for more info or do a search on "PHP CLI".

We haven't compiled a list of functions that aren't supported.

> I asked about Header() because PHPlot was using them, and I noticed that not

> even that data was being outputted. I'll grant you that not having Header()

> work isn't a big deal, but it goes back to my question above about knowing

> what is/isn't supported with SmartPill.

>

> Please don't get me wrong - I think SmartPill is a great tool and I look

> forward to using it 'for real'.

No problem, I'm happy to answer any questions...

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.