require() or exec()

Hey all,

I’ve writen a fairly complex set of scripts to convert XHTML into a PDF.

I have one script that will take an input XML file, format it, and save a new XML file.

There is another script that takes that new XML file and does the processing

My problem is, I’m having to access the first script from the browser first (to generate the XML), and then the second (generate the PDF).

What I’d like to do, is just include the XML generator in the PDF generator.

I’ve used require(XML_Generator.php). It does not give me an error, but it DOES NOT create the XML for me. I have to access it directly from the browser.

So, should I use exec() and access this file with the cli? Is there another way around this?

Hope this makes sense! Thanks for the help!

require() is safer than exec(), and most hosts have exec() disabled for just that reason. Unless you run the scripts locally, exec() is usually not an option. I’m thinking there’s a problem with arguments that should be passed, but I don’t know if that’s the mechanism you’re using.

Sponsor our Newsletter | Privacy Policy | Terms of Service