I’ve been told (from a previous question of mine) that to run an external PHP script, i could use exec or curl.
I’ve started looking into exec and it seems simple, however I believe I am doing something incorrectly.
Is this not the correct, simple way to just run a page (and not require any data returned)?
exec("/folder/some_page.php?var=" . defined_variable);
I’ve tried different combinations of relative and direct links, with/without starting with a slash.
Thanks everyone!
exec()runs a program, not a script. In your case, you’d need to call thephpexecutable and pass it the path to the folder on the server. You’d also have to use the command line syntax for passing query parameters, not the URL syntax.See here for more details on command-line PHP usage (which is what
exec()is essentially doing, minus the interactive component): http://php.net/manual/en/features.commandline.php