I just had a thought about the way I'm doing something in my application.
I have an application which generates a PDF using tcpdf. I also use a graphing program to out put an image to a file and then I include that file in the pdf. What I'm ALSO doing that may not be the best way is, I am using an include to run the script that creates the image. Since I'm not actually including anything from the file that contains the graphcode, I only need to execute the code, let it output the graphic and include the graphic.
Should I be using exec() instead and are there any benefits or downsides to doing so? I've only ever used includes and it just never occurred to me to do it another way.
Thanks.
include() or exec()
Moderator: General Moderators
-
Bruno De Barros
- Forum Commoner
- Posts: 82
- Joined: Mon May 12, 2008 8:41 am
- Location: Ireland
Re: include() or exec()
The code that outputs the graphic, is it PHP? Because if it is, then I don't see why you'd have to use exec(), as exec() is for executing external programs.
Re: include() or exec()
The code that creates the graphic is php but there is some compatibility issues between the graphics program and PDF creation program that it's going in to so I have to output the image to a file first.