PHP include for extra php code
Permalink
I am trying to achieve the form found here:
https://www.allphptricks.com/create-a-zip-file-using-php-and-downloa...
but I can't get the php code to stay on the page - C5 seems to strip it out.
I have tried:
- the free PHP block (on the page and on the page type) - strips it out
- before the C5 include in the header file - strips it out
- as an include at the top of the downloads page after the header include - strips it out
Any suggestions please?
https://www.allphptricks.com/create-a-zip-file-using-php-and-downloa...
but I can't get the php code to stay on the page - C5 seems to strip it out.
I have tried:
- the free PHP block (on the page and on the page type) - strips it out
- before the C5 include in the header file - strips it out
- as an include at the top of the downloads page after the header include - strips it out
Any suggestions please?
Sounds like a great idea but I don't have the programming skills being only a lowly front-end developer.
Any tips on how to do this for a simpleton like me?
Any tips on how to do this for a simpleton like me?
How do you find it's stripped out?
If you simply right-click in the browser and check the source code, PHP will never be shown as it only works on the server, not on the user.
If you simply right-click in the browser and check the source code, PHP will never be shown as it only works on the server, not on the user.
I've never had any problems with the php block. Put something simple in there to get the hang of it. Off the top of my head, this might do something:
<?php phpinfo(); ?>
Just to clarify: no php code will be shown in the browser, only the result of php processing. In that case, the result of the php function should be shown, the php code itself won't.
@linuxoid: just to clarify, I totally agree with you!
Ah! That makes sense.
Yes the php script from the source code straight from Chrome is not showing.
I have the php code sitting just above the order form (as per the tutorial file).
When I test the form the javascript kicks in withe the button interactivity but then the php gather/zip/send process dies with no file/s being downloaded.
Yes the php script from the source code straight from Chrome is not showing.
I have the php code sitting just above the order form (as per the tutorial file).
When I test the form the javascript kicks in withe the button interactivity but then the php gather/zip/send process dies with no file/s being downloaded.
If you use the php code in a php block, the php will try to pick the files relative to the block location (correct me someone if I'm wrong). I guess you don't know the block path and simply upload the files in some folder. That may be why they're not found by php.
And I don't think sending the header is possible within C5.
And I don't think sending the header is possible within C5.
https://documentation.concrete5.org/developers/working-with-blocks/c...