Code: Select all
// The upload configuration
// NOTE: You dont have to set every value!
// Like below, we have not set the "size", so the default configuration
// value is used (max size which is possible).
$cfg = array(
"path" => $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).'/uploads/',
"type" => "jpg jpeg",
"name" => "picture1", // <-- keep the original name
"required" => true,
"exists" => "rename"
);
// upload field
$form->uploadField("Great! Now load your pictures. Hit the browse button and it will take you to where ever you saved your picture at on the computer. Your front screen, when you turn on your computer, is called the desktop. If you can see your pic icons there, then use the browse to find your pic under desktop. If they are on disk, again, go to D:/(or the appropriate drive) via brouse and you can attach them from there. My Documents may be another common place they would be.", "picture1", $cfg);
// The upload configuration
// NOTE: You dont have to set every value!
// Like below, we have not set the "size", so the default configuration
// value is used (max size which is possible).
$cfg = array(
"path" => $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).'/uploads/',
"type" => "jpg jpeg",
"name" => "picture2", // <-- keep the original name
"required" => true,
"exists" => "rename"
);
// upload field
$form->uploadField("Upload your second picture", "picture2", $cfg);
// The upload configuration
// NOTE: You dont have to set every value!
// Like below, we have not set the "size", so the default configuration
// value is used (max size which is possible).
$cfg = array(
"path" => $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).'/uploads/',
"type" => "jpg jpeg",
"name" => "picture3", // <-- keep the original name
"required" => true,
"exists" => "rename"
);
// upload field
$form->uploadField("Upload your third picture", "picture3", $cfg);
// The upload configuration
// NOTE: You dont have to set every value!
// Like below, we have not set the "size", so the default configuration
// value is used (max size which is possible).
$cfg = array(
"path" => $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).'/uploads/',
"type" => "jpg jpeg",
"name" => "picture4", // <-- keep the original name
"required" => true,
"exists" => "rename"
);
// upload field
$form->uploadField("Upload your forth picture", "picture4", $cfg);
// The upload configuration
// NOTE: You dont have to set every value!
// Like below, we have not set the "size", so the default configuration
// value is used (max size which is possible).
$cfg = array(
"path" => $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).'/uploads/',
"type" => "jpg jpeg",
"name" => "picture5", // <-- keep the original name
"required" => true,
"exists" => "rename"
);
// upload field
$form->uploadField("Upload your fifth picture", "picture5", $cfg);
if( $form->value("picture5") != '') {
$form->addValue( "picture5", "/uploads/".$form->value("picture5") );
}
// submitbutton beneath it
$form->SubmitButton("Submit"); // the options
// set the 'commit after form' function
$form->onCorrect("doRun");
// send the form to the screen
$form->Flush();
// function to show a message
function doRun($data) {
return "Hello ". $data["name"];
}
?>
</form>