21288 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 444 Views |
-
EXECUTING INDEPENDEN PHP SCRIPT

15 March 2011 at 10:35pm
Hello
I have a php script updatescript.php in a folder code/mycode/ updatescript.php
I solved the problem of accessing the script py putting a .htaccess file in the folder with :
<Files updatescript.php>
allow from all
</Files>It is working and I have access to it but my problem now is that it seems that I can not execute the script .
Is there some other instrcution/permission I have to give for it to work ?
Thank you
-
Re: EXECUTING INDEPENDEN PHP SCRIPT

16 March 2011 at 6:04pm
Are you executing it via the web interface or cli? The default .htaccess will route any requests to php files through sapphire/main.php so that users can not simply download all your files. I would recommend writing a simple SilverStripe controller to wrap your script. Something like
<?php
class MySpecialController extends Controller {
function index() {
require_once '/path/to/file.php';run_something();
}
}Then you can hit the URL site.com/MySpecialController/
| 444 Views | ||
|
Page:
1
|
Go to Top |


