The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
File Upload Help - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Modules (https://forums.formtools.org/forumdisplay.php?fid=16)
+--- Thread: File Upload Help (/showthread.php?tid=126)



File Upload Help - scaphis - Apr 23rd, 2009

For those who don't know - I just figured out why my upload was not working. Form Tools cannot create an file upload script for you - you have to do it yourself. First I made sure my server was configured for file uploads, and I had them add a tmp folder in the php ini settings. I dont know if that did anything but I will mention it anyway.

Now- I found a script online for file uploads and I adapted it to work with my form.

MAKE YOUR FORM START WITH THIS:

<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" enctype="multipart/form-data">

INSTEAD OF THIS:

<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post">



Then add this below the submit button on your form:

<?php
if (isset($_POST['YOUR SUBMIT BUTTON NAME'])){

// Define the upload location
$target_path = "c:\\";

// Create the file name with path
$target_path = $target_path . basename( $_FILES['YOUR FILE FIELD NAME']['name']);

// Try to move the file from the temporay directory to the defined.
if(move_uploaded_file($_FILES['YOUR FILE FIELD NAME']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['YOUR FILE FIELD NAME']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
}
?>


Replace these values with your own:

YOUR FILE FIELD NAME
YOUR SUBMIT BUTTON NAME


That should make it so you can upload files with your own php form


RE: File Upload Help - Jaace - Sep 21st, 2009

Will this work across multiple forms? Meaning, if my form has a second page and some of my uploads are on the first page and some on the second (which is my last page), will this allow me to save all that data at once. I remember it being a problem when trying to carry uploaded files in the SESSION or something like that. I had to resort to making a one page form that LOOKED like a two page form, kind of hackish and I didn't like it :/