NAME="subscription_form"; $form->METHOD="POST"; $form->ACTION=""; $form->ENCTYPE="multipart/form-data"; $form->debug="trigger_error"; $form->ResubmitConfirmMessage="Are you sure you want to submit this form again?"; $form->AddInput(array( "TYPE"=>"file", "NAME"=>"userfile", "ACCEPT"=>"image/gif", "ValidateAsNotEmpty"=>1, "ValidationErrorMessage"=>"It was not specified a valid file to upload" )); $form->AddInput(array( "TYPE"=>"submit", "VALUE"=>"Upload", "NAME"=>"doit" )); $form->AddInput(array( "TYPE"=>"hidden", "NAME"=>"MAX_FILE_SIZE", "VALUE"=>1000000 )); $form->LoadInputValues($form->WasSubmitted("doit")); $verify=array(); if($form->WasSubmitted("doit")) { if(($error_message=$form->Validate($verify))=="") $doit=1; else { $doit=0; $error_message=HtmlEntities($error_message); } } else { $error_message=""; $doit=0; } if(!$doit) { if(strlen($error_message)) { Reset($verify); $focus=Key($verify); } else $focus='userfile'; $form->ConnectFormToInput($focus, 'ONLOAD', 'Focus', array()); } $onload=HtmlSpecialChars($form->PageLoad()); ?> Test for Manuel Lemos' PHP form class to upload a file

Test for Manuel Lemos' PHP form class to upload a file


GetFileValues("userfile",$userfile_values); ?>

The file was uploaded.

Uploaded file path:
Client file name:
File type:
File size:
StartLayoutCapture(); $title="Form upload file test"; $body_template="form_upload_body.html.php"; include("templates/form_frame.html.php"); $form->EndLayoutCapture(); $form->DisplayOutput(); } ?>