Thank you for you help, I think I'm close but...
I get this: Warning: Array to string conversion in /nfs/users/ttspike/public_html/deluxe/learnphp/newprocess.php on line 11
Details:
The form with the file input tag newattachment is included such as:
error_reporting(E_ALL);
if ($action == 'first_time') {
<bunch of mysql processing, etc. snipped>
include("form_add_item.php"); // Which includes: <input name="newattachment" type="file" size="40"> and <input type=submit name="add_another" value="Add Another">
}
then I come through a second time, array in tow:
if (isset($add_another)) {
<bunch of mysql processing, etc. snipped>
$targetpath = "/users/ttspike/public_html/deluxe/learnphp/attachments/";
echo ("attachment data ".$FILES['newattachment']." ".$FILES['newattachment']['name']."<br>"); // Which produces: attachment data Array sticker_copper_only_2x3.jpg
$attacharray = $FILES['newattachment'];
$attachname = $FILES['newattachment']['name'];
upload_attachment($attacharray, $attachname, $targetpath);
}
I also tried with, no surprise, the same results:
upload_attachment($FILES['newattachment'], $FILES['newattachment']['name'], $targetpath);
the function:
function upload_attachment($userfile, $filename, $target) {
if (file_exists($userfile)){...
}
I get a pause as if the file is uploading but then:
Warning: Array to string conversion in /nfs/users/ttspike/public_html/deluxe/learnphp/newprocess.php on line 11
Line 11 is "if (file_exists($userfile)) {", and no file appears in the server directory.
I've attached the full script if you care to peek.
Thank you for your time, patience and altruism.