Tag: PHP

On:

Yesterday I needed a PHP password generator for the soon to be migrated FileMaker users logins. I found a list of nouns and needed a random picker. A file seemed better than in memory. AI then suggested going to a random byte, then getting the next line which is fast even with large files!

PHP

PHP as Text

function strRandomNoun() {
    // Open File
    $filePath = PATH_ROOT_XAN . 'data-nouns-2315.txt';
    $fileSize = \filesize( $filePath );
    $file = \fopen( $filePath, 'r' );

    // Loop
    do {

        // Random Noun
        $randomByte = \random_int( 0, $fileSize - 1 );
        \fseek( $file, $randomByte );
        if ( $randomByte  ...
On:

Today on a FileMaker Reddit Post, I was asked what the code looks like. I start with a selected Contact record and starting with index.php, I show an over view of the code path and the code for the Contacts Info Card.

It's interesting to hear similar stories from fellow Developers like on that Reddit Post. FileMaker and Xojo have both, but separately, raised pricing. No official announcements have been made from ...

On:

We've been converting FileMaker databases to Xanadu Web Apps over the past few years. One conversion category is Reports. Reports vary, but there are four types:

  • 'Simple' with zero or minimal parameters with a simple query.
  • 'Flexible' reporting on ad hoc record sets with a simple query.
  • 'Forms' with data placed at specific coordinates.
  • 'Customized' with complex formatting, more than one format, or multiple queries.

For most reports, we use mPDF, a popular open-source PHP library for generating PDFs. We'll create a header, footer, and body in HTML using CSS for the styling and applying ...

On:

Reposted from INN: https://ifnotnil.com/t/php-for-xojo-programmers-0003-variables-from-the-url/1733

URL Variables

This time we'll work to add variables to the URL like "/products.php?item=widget" rather than create one page for every product. We could have 500 products and only need one PHP page and one HTML Template.

When we talked about Includes we had three files "template.htm", "helloWorld.php", and "helloEarth.php". That worked well but now let's now use variables to replace the need for multiple PHP pages.

Prep

Start off by duplicating "helloEarth.php" ...

On:

Reposted from INN: https://ifnotnil.com/t/php-for-xojo-programmers-0002-includes/1727

Includes

This time we'll talk about "includes". Includes are a way to pull in a file into the current file to reduce repetitive code or templates. Below we'll show how to make a simple template and use it.

We use Includes in Xanadu which is open source: https://github.com/campsoftware/xanadu

Here's Xanadu's template for almost every page. It'll look overwhelming, but broken down it's a simple template as well. https://github.com/campsoftware/xanadu/blob/master/templates/page-resp.php

Previously...

Last ...

On:

Reposted from INN: https://ifnotnil.com/t/php-for-xojo-programmers-0001-hello-world/1726

This is the first post in a series about PHP from a Xojo perspective.

I'll be showing how I developed different parts in detail of Xanadu which is open source: https://github.com/campsoftware/xanadu

Hello World!

When I first used Xojo I did the same thing you probably did. I dragged out a button and when clicked it showed a message box that just said 'Hello World'.

Think about what Xojo might be doing to make this work.

  • Define the page, even if blank
  • Define ...
On:

NOTE: Since posting this, we've made Xanadu semi-private.

Xanadu is reincarnated as a Web App developed in PHP / HTML / CSS / Bootstrap / Javascript. If you haven't heard of Xanadu it's a framework for developing Database Driven Web Apps.

It's been a long road, but Xanadu is a good place now. If you haven't heard about the speed bumps we hit with FileMaker and Xojo, we posted a bit about it last year. Not much has changed with FileMaker and Xojo since. FileMaker is still very expensive for Small Businesses as they focus on Enterprise. Xojo released Web 2.0 over the past year in pre-alpha quality. While Xojo has been ...

On:

It's been a while since my last blog post. There's a reason for that. Software Development has been disappointing, but after five years, I'm ecstatic again!

Why? I think it has to do with greed along with a lack of communication. I'm just glad to see the pattern and have the technical ability to change development platforms.

As developers, what do we need? That depends on the app. Some apps are hardware generic while other apps need specific hardware features. We primarily develop database apps where folks view/edit data, print to paper or PDF, and document management. There aren't many specific hardware feature we need other that being able to work offline when internet isn't available.

There are lots of app types: Desktop ...