Apr 18th, 2010, 10:20 AM
Hi Rob,
Very good question. First off, you couldn't use an http:// URL, you can only use a server path to include files.
Off the top of my head I don't know, but you could find out like this. Add the following into your rule:
That will print the folder that the submission preparser code is running in.
You can use that location to construct the path to your include file. e.g. if your folder was 3 folders up, then two folders deep, you could do something like:
The realpath function will convert that whole shebang into a valid file path.
Hope this helps.
- Ben
Very good question. First off, you couldn't use an http:// URL, you can only use a server path to include files.
Off the top of my head I don't know, but you could find out like this. Add the following into your rule:
PHP Code:
$folder = dirname(__FILE__);
exit;
That will print the folder that the submission preparser code is running in.
You can use that location to construct the path to your include file. e.g. if your folder was 3 folders up, then two folders deep, you could do something like:
PHP Code:
$include_file_location = realpath("$folder/../../../my/folder/filetoinclude.php");
include($include_file_location);
The realpath function will convert that whole shebang into a valid file path.
Hope this helps.
- Ben