Use PHPRunner applications in WordPress

This template lets you turn a PHPRunner project into a native WordPress plugin and insert application pages into WordPress posts or pages using shortcodes. WordPress users can be logged in to the application automatically and assigned the corresponding permissions.

The template also supports ASPRunner.NET projects. Users who are already logged in to WordPress can be logged in to the application automatically and assigned the corresponding permissions.

What can you build?

  • Display database lists, forms, reports, and other application pages inside WordPress
  • Insert application pages into WordPress posts or pages using shortcodes
  • Use WordPress authentication with your PHPRunner or ASPRunner.NET application
  • Connect your application to MySQL, Oracle, Microsoft Access, SQL Server, or PostgreSQL

You can get this template for $50.

Buy now

Screenshots

List page in WordPress
Edit page in WordPress
If you try to access a page without logging in
Inserting your application into a WordPress page using shortcodes
New to PHPRunner?
PHPRunner turns your database into a complete web application that you can customize and deploy on your own server. Learn more about PHPRunner.

System requirements

  • Version 11.1 or better of PHPRunner or ASPRunner.NET
  • Supported databases are MySQL, Oracle, Microsoft Access, SQL Server and PostgreSQL

Setup instructions

  1. Create a new project based on the WordPress template or add the WordPress template to an existing project. You can use any supported database; it does not need to be the same database that WordPress uses, and it does not need to be MySQL.
  2. Recommended project settings: use 'AJAX search, pagination and sorting' and choose to open Add, Edit, and View pages in a popup. This can be configured on the 'Pages' screen under 'List page settings'.
  3. Projects without security. If your project doesn't require login you can skip bullets 4-8.
  4. If your project has security enabled proceed to the login page in Page Designer, and insert the HTML snippet above the login form and paste the following text there 'You need to be logged in to WordPress in order to see this page'. Also set Item ID of this snippet to be wptext. The idea is to show users that they need to be logged in to WordPress first.
  5. There are two options for automatically logging WordPress users in to your PHPRunner or ASPRunner.NET project. To switch between these two options proceed to 'WordPress settings' menu item. Make sure to create corresponding user or users in your login table.

    You can either log users in using their WordPress username or assign the same application username to all WordPress users. To make sure you have access to WPSettings Edit page add a user to the login table with the same username as the one you use to logon to WordPress.
  6. If you created a new project from scratch you can skip steps 6-9 as this code will be created automatically.
    Add the following code to Login page: Before Display event:

    PHP C#
  7. Add the following code to AfterAppInit event:

    PHP C#
  8. Add the following code to Login page: Javascript OnLoad event:

    PHP/C#
  9. For all tables you add to the project later specify the following code in the following events.

    Add page: Javascript OnLoad event: Edit page: Javascript OnLoad event:
  10. Now build the project. Once it is built, go to the WordPress installation folder on the web server, open wp-content\plugins, and create a subfolder named wpphprunner. Copy all files from the output folder to wpphprunner. Then open the WordPress control panel and enable the wpPHPRunner plugin.
  11. If the plugin was activated successfully, you are ready to use it. Open any post or page in WordPress and use the following shortcode to insert your application. You can use the URL of any page from your project. PHP C#
  12. The next step is to adjust the appearance. Depending on the WordPress theme you use, your application may need some additional styling. We tested it with several different themes and these are the ones where it looks the best: Twenty Nineteen, Hello Elementor, Head Blog, Vilva, Sydney, Zakra.

    Even with these themes, you may want to make some CSS changes so your application uses the full width of the page. The following CSS can be either added to your theme Custom CSS area or to the Custom CSS section in your PHPRunner or ASPRunner.NET project.

    Twenty Nineteen

    Hello Elementor

Additional ASPRunner.NET instructions

WordPress and the plugin itself are written in PHP, which makes integration with an ASPRunner.NET application a little more involved. Follow these additional steps to complete the setup.

  1. The following folder needs to be set as 'an application' in IIS: <wordpress folder>\wp-content\plugins\wpphprunner\
  2. If your ASPRunner.NET uses MySQL and connects to the same database as WordPress there is nothing else to do. If your project connects to another database i.e. to SQL Server the easiest option is to create and populate wpsettings table in WordPress database manually. Here is the SQL script you can use to create this table.

More code examples

Because your project runs inside WordPress, some event code may need small adjustments. For example, if you need to redirect a user to another page after a record is added or edited, use the following approach. Replace cars_list.php with the name of your actual page.

PHP:

C#: