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.

Execute PHP in branded index page (stats)

Discussion in 'cPanel Developers' started by CodyRo, Jun 4, 2009.

  1. CodyRo

    CodyRo Registered

    Joined:
    Apr 30, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I'm looking to execute PHP in the branding/index.html file - namely in the stats area. I've scoured the forums and have come across a couple of suggestions / references to how cPanel handles PHP execution within themes.

    http://forums.cpanel.net/f42/cp-includes-possible-include-php-file-96049.html
    http://forums.cpanel.net/f42/adding-rows-stat-html-data-gathered-php-script-76243.html

    What I've tried ..

    I've renamed branding/index.html to the following:

    index.php
    index.phpcp
    index.cpphp

    I've tried to both include PHP directly in that template, and include an external file (using the test.phpcp / test.phpcp symlinks provided in the base of the template directory). Unfortunately it still isn't executing the PHP and only spitting out the source.

    Am I doing something wrong?
     
  2. CodyRo

    CodyRo Registered

    Joined:
    Apr 30, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    It appears to be a caching issue, time to investigate that :).

    **EDIT**

    I may have been mistaken - can someone help clarify with the information I've provided?
     
    #2 CodyRo, Jun 4, 2009
    Last edited: Jun 4, 2009
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Are you sure you're looking at index.php/index.cpphp/index.phpcp and not index.html?
     
  4. vinodwedhera

    vinodwedhera Registered

    Joined:
    Jul 7, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    use php in cpanel index file

    please tell me
    how can i use php in index file
    and how do i change index.html to index.php,phpcp,cpphp
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You can change index.html to index.php, index.phpcp or index.cpphp by renaming the file. Only once there is "php" in the file extension can PHP be used in the index file.
     
  6. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I saw your post in the other thread, I'll follow up on that other thread.
     
  7. littohouston

    littohouston Member

    Joined:
    Jan 3, 2010
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    What file is it exactly that i rename? will it be the index.html file that is in my "branding>x3" folder?
     
Loading...

Share This Page