This works great except for one inconvenence, after arriving on mypage_view.php theI images are blank until I refresh the page and then they all show up.
So I tried finding a way to on page load refresh the page just once; was never able to find a way to do that.
My next idea is this, there must be a function somewhere that processes the contents of the $adminConfig[] array in config.php whenever the page is loaded. Does anyone know what this function is and where it is located? My thinking is I can call the function to process $adminConfig[] within the init section of mupage.php.
If I am wrong here please tell me why so I can learn and also solve the issue of having to refresh the page in order to see the images. BTW, this Appgini app is used as the backend for the website owner to upload images, etc.
TD
Code: Select all
config.php:
<?php
session_start();
$dbServer = '’;
$dbUsername = '';
$dbPassword = '';
$dbDatabase = '';
$appURI = '';
$host = 'localhost';
$adminConfig = [
*** other elements removed for clarity ***
'baseUploadPath' => "images",
];
$fldr = $_SESSION['fdr'];
$adminConfig['baseUploadPath'] = $fldr;
Code: Select all
/hooks/mypage.php
<?php
// For help on using hooks, please refer to https://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks
session_start();
function mypage_init(&$options, $memberInfo, &$args) {
$_SESSION['fdr'] = 'images/gallery/mypage/';
return TRUE;
}