Rick
|
| Posted: 04/01/2002, 5:43 AM |
|
I'm trying to incorporate the phpUpload example into my site. In order to upload files, the example places a form for uploading files in the footer. This html code also contains php code. The problem is that I'm using php+templates and not php only. Is there a way I can place php code in the footer? I did not see any satisfactory answers to similar problems while searching the discussions. Any assistance would be appreciative.
Thanks.
Rick
|
|
|
 |
Nicole
|
| Posted: 04/01/2002, 5:55 AM |
|
Rick,
PHP Upload example was created for PHP pattern not for PHP+Templates. To make it work for PHP+Templates some modifications are required.
Go to AdminRecord page/AdminRecord form/Properties/Header&Footer tab/Footer section and replace the existing code with the following one:
<FORM ENCTYPE="multipart/form-data" ACTION="UploadResult.php?item_id={value}" METHOD=POST>
Or attach file: <INPUT NAME="myfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Attach File">
</FORM>
And create BeforeShow event for AdminRecord form:
$tpl->set_var("value", get_param("item_id"));
|
|
|
 |
Rick
|
| Posted: 04/01/2002, 6:10 AM |
|
Thanks Nicole for your help.
One last question. In the example, If someone tries uploading a file before submitting the form above it, you get an error message. I was going to try to display the footer only if a value existed for item_id. Example:
if ($flditem_id <> ""){
echo "HTML CODE";
}
Will this need to be modified in the html file after finished using cc, or can it be custom done in cc?
Thank again,
Rick
|
|
|
 |
Nicole
|
| Posted: 04/01/2002, 11:36 PM |
|
Rick,
in latest CC version 2.0.5 you can hide form's footer the same way as hide forms.
Do not edit anything in the AdminRecord page->AdminRecord form's footer and put hide footer code to form Open event. E.g.:
if (condition)
$tpl->set_var("FormFormNameFooter", "");
BTW, CC 2.0.5 is available at: http://codecharge.com/updates/cc2_0_5.html
|
|
|
 |
|