Need better Conditional for php include file

PHP project, Apache server, mysql database

My index page is the login page. Username & password.

  1. LoginCheck API – compare posted username & password to table.users records – find matching record or no find & pass “unauthorized/not logged in” back to Browser Go action.
    Pull user business name, address, city, postal code, email values to bind into the first 5 fields as Read Only text in the Form page.

Now I want to include the form.php file into the login page instead of putting it into the browser go to action.

When the include file is pulled in to the login (index,php) the user details must be bound into the form fields when rendered.

The standard conditional region method pulls in the form page without the api query values bound into the form fields even though the user details query has run and the form code is still showing the same bind values.

I need the include to happen as the last action of my API which verifies the login form credentials and grabs the user details for the binding values in my form.

How do I get an include file to happen with the same time execution order as my Go To Browser action when I am using the Security Provider method?

Okay. Sort of SOLVED . . ,

I still have this code on my login form page where I want the Form.php page to display after the User submits their Login credentials and are authorized to see and fill in the Form.php.

> <div id="conditional1" is="dmx-if" dmx-bind:condition="serverconnectform1.data.query_userdetails.apo_Kunden_ID > 0 " >
>     <?php include 'working_form2.php'; ?>
> </div>

With some more coding and extending my first Login API and using this conditional div on the Login page the Form does not appear even though it IS LOADED and rendered in a HIDE region condition. By default it is Hidden.

When the login credentials are submitted the API queries run. If the user is Authorized then the Form displays just below the USERNAME and Password fields and Submit button.

And, most importantly, the loaded form page has re-loaded, instantly re-rendered with the authorized user details now bound correctly in their places in the form.

It works but I didn’t find the way to stop the form page from loading in the first place where it stays hidden.