PHP in skins? Please clarify...

thoroughfare

Verified User
Joined
Aug 11, 2003
Messages
575
Hi,

When I first asked this I was told that you can't put PHP into skins. Now it seems you can... but what exactly can I put in there? What restrictions are there? Does it run as admin or root? Safe mode on or off?

Would I have access to mail() and mysql functions?

Much appreciated,
Matt :)
 
Hello,

It was added a few months back as a new feature. You can run any scripting language you want, just put the interpreter you want at the top of the script.

There is a really simple example here:

http://www.directadmin.com/features.php?id=285

You can do anything you want via the script. The script is run as the user who's using it, so if "bob" was logged into DA, it would run as "bob". mail() will work if it works everwhere else, and safe_mode will be set to whatever you have in your /usr/local/lib/php.ini file. DA doesn't do much more than call the program and pass it the script. (plus environmental variables).
Yes, it will have the mysql functions too :)

Note that it's not limited to php, you can use perl, even sh scripts if you felt like it. :)

John
 
Fantastic John! When I have time in July I'm planning some big customisations, and this new feature saves me from completely relying on the API (and parsing the API functions which are HTML-only ;))... brilliant!

Matt :D
 
Back
Top