Hi jsetzer, thank you for trying to help! Sorry for the delayed response. As for your comments:
Shouldn't it be duck_season_2015.php with underscores instead of hyphens?
To create this Appgini project I imported an existing database which had tables names with both underscores and hyphens. To change the existing database table names would have broken the entire website. Luckily for me, Appgini allowed me to change the table names in the project only, using names with all underscores, without having to modify the existing database.
I think echoing a string will not have any effect here, because after insert process appgini will redirect to another page and the script command will not be passed over into the follow-up page.
My bad, I was just using an 'echo' command to test if and when the code worked. It was just for testing and I should have indicated that.
(3) there are many different ways starting from $_GET or $_POST parameters via $_SESSION variables up to database storage. It really depends on your specific scenario and requirements. Maybe you should specify what exactly you want.
Strangest thing is right after I post a topic the answer just seems to come to me...$_SESSION variables is the only way to go here.
NOW FOR THE BIG NEWS:
After an embarrassing amount of trial and error I was able to arrive at a working solution that appears to be rock solid though I will be doing multiple user testing to verify it is safe to use.
Here is my solution to uploading images to differnet folders on the server:
/hooks/duck-season-2015.php
Code: Select all
<?php
// For help on using hooks, please refer to https://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks
session_start();
function duck_season_2015_init(&$options, $memberInfo, &$args) {
$_SESSION['fdr'] = './images/gallery/duck_season_2015/';
return TRUE;
}
/config.php:
Code: Select all
<?php
session_start();
$adminConfig = [
/* section left out for clarity */
];
$fldr = $_SESSION['fdr'];
$adminConfig['baseUploadPath'] = $fldr;
That's it ,really simple, just add the code to each of the /hooks/pages that will be used to upload images to specify where the images get uploaded to.
I will be sending this solution to Appgini support to see if they see any problems with this.
TD