Find user homedir
Hello
In x3 I was using below code to find user's home dir
$homedir = $_CPANEL['USERDATA">['home">;
Can someone please tell how can I find user homedir using live.php file ?
Thanks
-
Hello, The "homedir" return is part of the following UAPI function: UAPI Functions - DomainInfo::domains_data - Software Development Kit - cPanel Documentation We document an example of how to use that UAPI function with LiveAPI at: Tutorial - Create a New Paper Lantern Interface in PHP - Software Development Kit - cPanel Documentation Guide to the LiveAPI System - PHP Class - Software Development Kit - cPanel Documentation Thank you. 0 -
Hello, This is still not working at my end if someone could explain more please in x3 I used this $HOMEDIR = $_CPANEL['USERDATA">['home">; function get_settings() { global $HOMEDIR, $SETTINGS; $phpini= file_get_contents("$HOMEDIR/php.ini"); note that my script works perfectly if I save it .php but header and footer will be missing and if I save it .live.php it returns with an error in the new paper lantern theme I tried the following : uapi( // Get domain user data. 'DomainInfo', 'domains_data', array( 'format' => 'hash', ) ); function get_settings() { global $HOMEDIR, $SETTINGS; $phpini= file_get_contents("$get_userdata/php.ini"); ?>
but didn't work. please advice and is it still possible to use header and footer in .php ? what will be the code Thank You0 -
note that my script works perfectly if I save it .php but header and footer will be missing and if I save it .live.php it returns with an error
and is it still possible to use header and footer in .php ? what will be the code
We document how to do this under "Step 2" at: Tutorial - Create a New Paper Lantern Interface in PHP - Software Development Kit - cPanel Documentation What specific error message are you receiving? Thank you.0 -
is there any way to keep using .php header and footer and avoid .live.php ? because my script is running perfectly when i save it .php the only thing is that its missing the header/footer, my only issue is with $HOMEDIR with live php,
You could use Template Toolkit instead if you have no requirement for PHP at all: Tutorial - Create a New Paper Lantern Interface - Software Development Kit - cPanel Documentation Otherwise, consider sending an email to integration@cpanel.net[/EMAIL] for additional feedback on your custom script. Thank you.0
Please sign in to leave a comment.
Comments
5 comments