Firstpost - enjoy modx hate old docs waiting for revolution sigh...
So I am wet behind the ears with PHP though I understand enough to make basic things works and know my around but still learning.
Here is the issue.
So I have a front end user form with basic input text fields etc and these output fin.
Issue Time YES!!!I also need it to be able to upload images as well which it can e.g longblob but as we all
know saving images to a db is good way to get a nasty bill.
processing the data but I looked high and low for a file upload
<?php
function formtodatabase( &$fields )
{
global $modx;
$dbTable = array();
$dbTable[location] = $fields[location];
$dbTable[itemname] = $fields[itemname];
$dbTable[price] = $fields[price];
$dbTable[disc] = $fields[disc];
//Nightmares
$dbTable[saleimg_1] = $fields[saleimg_1];
$dbTable[saleimg_2] = $fields[saleimg_2];
$dbTable[saleimg_3] = $fields[saleimg_3];
/*Code here?
Please Mr.PHP send my paths to the db
and sir...store the images in a folder
Mr.php don't ask me google and get 100 hundred forums of nonsense
I know you asked for mysql&php but asp seemed like a good bet too!!!
*/
// Run the db insert query
$dbQuery = $modx->db->insert($dbTable, 'forsale' );
return true;
}
?>
Or is there some sick joke by eform I have yet to be aware of?
I looked through tutorial hell but they are are so 1 minded and non-specific not to mention the fact that Eform is in this code gangbang, plus modx functions I might have missed.
So how the hell do I write a /path to the db and upload the image to a folder? I have been tearing through docs & API to no avail even reading through other snippets for a clue.
Any help would do wonders and thank you.
-Mike