Mikedata Posted March 30 Share Posted March 30 Here is the script ... It is used to upload files , It did work a few years back: Please advise [insert_php] use foundationphp\UploadFile; session_start(); require_once 'src/foundationphp/UploadFile.php'; if (!isset($_SESSION['maxfiles'])) { $_SESSION['maxfiles'] = ini_get('max_file_uploads'); $_SESSION['postmax'] = UploadFile::convertToBytes(ini_get('post_max_size')); $_SESSION['displaymax'] = UploadFile::convertFromBytes($_SESSION['postmax']); } $max = 1024 * 1024; $result = array(); if (isset($_POST['upload'])) { $destination = __DIR__ . '/uploaded/'; try { $upload = new UploadFile($destination); $upload->setMaxSize($max); $upload->allowAllTypes(); $upload->upload(); $result = $upload->getMessages(); } catch (Exception $e) { $result[] = $e->getMessage(); } } $error = error_get_last(); ?> size=10 {$error['message']} "; } if ($result) { foreach ($result as $message) { echo " · $message "; } }?> Top of Form Name...... >Enter Name >Rose James >Joseph Goldman * Must Be filled just once !!!!! Select File:_ data-postmax="" data-displaymax=""> Image Title 40max.: * Sequence:... Image 1 Image 2 Image 3 Makeup * Image 3 is for Final competition only !!!!!! Competition: Digital Creative Artistry Color Print Mono Print Nature Club Comp Journalist Assigned Special Other * Judges Comments:... No Yes * (See the Comments Policy or notes below) * All fields must be filled, I mean ALL. Even when you may have made a selction, GO BACK AND CHECK!!! Each file should be no more than . Submission Rules apply as before. Review submission policy Please check and recheck, before pressing the *Upload/Submit* button Some Browsers will not display a box to the left of the "Upload File" button, It is Ok. Press the button For Color Prints Or Mono Prints, Submit the file used for the print; using same size/rules mentioned above. If 'Competition Type' allows comments, Image 1 is automatically commented. If wanted, select yes for Images 2. Bottom of Form [/insert_php] Quote Link to comment https://forums.phpfreaks.com/topic/319536-insert_php-use-foundationphpuploadfile-in-a-page-do-not-work/ Share on other sites More sharing options...
Mikedata Posted March 30 Author Share Posted March 30 Let me add what is not working: When the page loads in the website. it shows this code and nothing more: [insert_php] use foundationphp\UploadFile; session_start(); require_once 'src/foundationphp/UploadFile.php'; if (!isset($_SESSION['maxfiles'])) { $_SESSION['maxfiles'] = ini_get('max_file_uploads'); $_SESSION['postmax'] = UploadFile::convertToBytes(ini_get('post_max_size')); $_SESSION['displaymax'] = UploadFile::convertFromBytes($_SESSION['postmax']); } $max = 1024 * 1024; $result = array(); if (isset($_POST['upload'])) { $destination = __DIR__ . '/uploaded/'; try { $upload = new UploadFile($destination); $upload->setMaxSize($max); $upload->allowAllTypes(); $upload->upload(); $result = $upload->getMessages(); } catch (Exception $e) { $result[] = $e->getMessage(); } } $error = error_get_last(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/319536-insert_php-use-foundationphpuploadfile-in-a-page-do-not-work/#findComment-1620023 Share on other sites More sharing options...
mac_gyver Posted March 30 Share Posted March 30 what does the 'view source' of the page in the browser show? do any other .php pages work? either the code starts with a short-opening php tag <? or php isn't working on the web server. Quote Link to comment https://forums.phpfreaks.com/topic/319536-insert_php-use-foundationphpuploadfile-in-a-page-do-not-work/#findComment-1620025 Share on other sites More sharing options...
Mikedata Posted March 30 Author Share Posted March 30 Thanks for responding. I am not sure if other php codes are not working or not, as everywhere else is OK. setting in the site is OK and The PHP is to the latest Viewing the source page, it is very large and lots of coding. Viewing it from wordpress it does not start with <? Since you mentioned, I did ad <? before [insert_php] and tried. No change it now displays the same with the <? Quote Link to comment https://forums.phpfreaks.com/topic/319536-insert_php-use-foundationphpuploadfile-in-a-page-do-not-work/#findComment-1620029 Share on other sites More sharing options...
Barand Posted March 30 Share Posted March 30 For over a decade now the correct opening tag for php has been <?php (unless short tags have been explicitly allowed). Quote Link to comment https://forums.phpfreaks.com/topic/319536-insert_php-use-foundationphpuploadfile-in-a-page-do-not-work/#findComment-1620031 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.