-
☆ A M B ☆
- 24,524 Posts
Keep in mind that it’s actually your index.php file that is processing the code here. So the path to your .php file needs to be relative to your index.php file. For example, if you created a folder in the assets/snippets folder you would need this:
require_once('assets/snippets/tera_wurfl/tera_wurfl.php');
I’ve tried that before. But it still can’t work
-
☆ A M B ☆
- 24,524 Posts
Try
$modx->config['base_path'].'path-to-your-php-file'
Where I must put that code into?
My snippet? or config files?
Where are the config files?
It sounds like you’re new to MODx. For now, why don’t you just create the snippet in the Manager and paste the code into it. Then there’s no need for a file. MODx will keep the code in the database and get it when it needs it. You can edit the code in the Manager (by editing the snippet) any time you want.
Doing it this way is more secure anyway rather than putting php code in files on the server where hackers can get at it.
Thanks Bob.I’ve think of that idea.
Nut I don’t know how to setting the configuration on tera-wurfl when I want to extract them to a one level files. No folder inside of them.
Actually I’m new of web developing, I just know how to use PHP, HTML and CSS.
Anyone know how to integrate tera-wurl on ModX?