The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP and <cpanel> tags

Discussion in 'General Discussion' started by JLain, Jul 10, 2006.

  1. JLain

    JLain Registered

    Joined:
    Nov 4, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Is it possible to send suexecperm(or any cpanel tag) a PHP var like this?

    PHP:
    echo '<cpanel Fileman="suexecperm($this_dir)">';
    or
    PHP:
    echo '<cpanel Fileman="suexecperm('.$this_dir.')">';
    This does not seem to work. I am guessing that CPanel tags dont work with PHP vars. Am I correct?

    Also, I am currently using

    PHP:
    <cpanel Fileman="suexecperm(public_html)">
    to change permissions on folders but is there a way to recursivly change permissions on a folder?

    Thank you in advance.
     
  2. NT

    NT Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    137
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    England, UK
    Hi,

    IIRC, PHP code only work on files with the .php extension, or where the extension is forced to be interpreted by PHP.

    Regards,
    Nick.
     
  3. elleryjh

    elleryjh Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    In cPanel PHP pages, the cpanel code is parsed before the php code, so no you can't pass in PHP vars. I believe you can only refer to GET / POST variables in <cpanel> tags.

    Since cpanel code is parsed first, you could pass the output of a <cpanel> tag into php:

    PHP:
    $var = <<<CPANEL_CODE
    <cpanel Fileman="suexecperm($this_dir)">
    CPANEL_CODE;
    I'm not advocating this because it could open up some possible security issues, just letting you know...


    Your other option would be to rewrite the cpanel function in PHP.
     
  4. JLain

    JLain Registered

    Joined:
    Nov 4, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the reply guys. I will try the GET and POST vars.
     
Loading...

Share This Page