I am trying to get the File element working in pfbc, but I am not getting anything other than the filename in $_POST['AvatarLrg'], $_FILES is empty. Does anyone have a working example I can peruse?
At the top:
<?php
$form = new Form('trucking_edit');
$form->configure(array( "enctype" => "multipart/form-data" ));
$form->addElement(new Element_File("Profile Avatar:", "AvatarLrg"));
$form->addElement(new Element_Button);
?>
And in the body:
<?php $form->render(); ?>
The form displays fine and all other elements display and work correctly, just the File ones :/
Any help appreciated.
Edit: Generated HTML:
<form method="POST" id="edit_profile" action="profile.php?pid=16&edit=save" name="tf_profileedit">
...
<div class="control-group">
<label class="control-label" for="trucking_edit-element-3">Profile Avatar:</label>
<div class="controls">
<input type="file" name="AvatarLrg" id="trucking_edit-element-3"/>
</div>
</div>
...
</form>
I found the problem; another form on the page was interfering with it (they overlapped because of old code). I removed the other form and it works. I could also remove the enctype line because PBFC automatically changes the enctype when you add a file element. Thanks guys for your help.