Home > Archive > PHP Language > October 2006 > Getting a PHP script to run another script without include or require
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Getting a PHP script to run another script without include or require
|
|
| theseer@gmail.com 2006-10-09, 7:59 am |
| Is it possible to get a PHP script to run another without using include
or require?
Because include or require treat the file as if they were in the same
directory they aren't usable in the situation I need them in.
| |
| Tyrone Slothrop 2006-10-12, 6:58 pm |
| On 9 Oct 2006 05:01:21 -0700, theseer@gmail.com wrote:
>Is it possible to get a PHP script to run another without using include
>or require?
>
>Because include or require treat the file as if they were in the same
>directory they aren't usable in the situation I need them in.
More info?
Just guessing what you need, you could define paths, chdir(), or run
from the shell with a system() call.
| |
| theseer@gmail.com 2006-10-12, 6:58 pm |
| I'm probably going to have change my original request.
What I'm asking is if there a way to execute another php script from
within one without using include or require. I'm pretty sure there is
I'm just not sure about ... what :)
Tyrone Slothrop wrote:
> On 9 Oct 2006 05:01:21 -0700, theseer@gmail.com wrote:
>
>
> More info?
>
> Just guessing what you need, you could define paths, chdir(), or run
> from the shell with a system() call.
| |
| Koncept 2006-10-12, 6:58 pm |
| In article <1160455641.949960.59730@i42g2000cwa.googlegroups.com>,
<theseer@gmail.com> wrote:
> What I'm asking is if there a way to execute another php script from
> within one without using include or require. I'm pretty sure there is
> I'm just not sure about ... what :)
For PHP5 - when dealing with classes - there is the "__autoload()"
method which you can redefine to specify paths to look in for class
files. This essentially can import class files which are not included
explicitly within your documents. Big time saver.
--
Koncept <<
"The snake that cannot shed its skin perishes. So do the spirits who are
prevented from changing their opinions; they cease to be a spirit." -Nietzsche
| |
| usenet@isotopeREEMOOVEmedia.com 2006-10-12, 6:59 pm |
| On Mon, 09 Oct 2006 07:23:18 -0700, Tyrone Slothrop <ts@paranoids.com> wrote:
[color=darkred]
>On 9 Oct 2006 05:01:21 -0700, theseer@gmail.com wrote:
>
If I understand your last sentence properly, the premise isn't correct.
Include() and require() can access any explicit or relative path on the server,
presuming the user account under which the web server runs has appropriate
rights:
include("../../includeme.php");
include("/some/path/from/root/includeme.php");
Also check out SCRIPT_FILENAME and DOCUMENT_ROOT at
http://us2.php.net/manual/en/reserved.variables.php
|
|
|
|
|