Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Including PHP files in CPanel themes

Discussion in 'General Discussion' started by amard, Aug 17, 2003.

  1. amard

    amard Well-Known Member

    Joined:
    Jan 18, 2003
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Herts, UK
    Hi,

    I thought it was as simple as adding

    PHP:
    <cpanel include="script.php">
    To include a PHP scripts output in a CPanel theme, although it just prints the contents of the PHP file.

    How do you execute a php script and then include the contents in a theme?

    For example, this would print "hello" in the theme and not <?PHP print "hello"; ?>:
    PHP:
    <?PHP print "hello"?>

    Thanks,

    Rob

    :)

    cPanel.net Support Ticket Number:
     
  2. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    166
    Not really possible since cPanel runs its own web server for WHM & cPanel.

    cPanel.net Support Ticket Number:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Faldran

    Faldran Well-Known Member

    Joined:
    May 28, 2002
    Messages:
    136
    Likes Received:
    0
    Trophy Points:
    316
    You have to rename that file .php instead of .html that you are having that include in..

    cPanel.net Support Ticket Number:
     
  4. Roy@ENHOST

    Roy@ENHOST Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    493
    Likes Received:
    0
    Trophy Points:
    316
    Location:
    Los Angeles California
    Not true. That will not work.
    You have to use the Cpanel include tag even if you are using PHP in cpanel.

    To include php in cpanel, just put the include file in your PHP library directory, easy as that.

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. SoftmegUK

    SoftmegUK Well-Known Member

    Joined:
    Feb 13, 2002
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    316
    Location:
    UK
    The best way I found was to make all the files .php then use good old PHP includes... worked a treat for me, if you use the cpanel includes i dont think it will run any code you have specified, would be like viewing it locally on your harddrive with no webserver :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Roy@ENHOST

    Roy@ENHOST Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    493
    Likes Received:
    0
    Trophy Points:
    316
    Location:
    Los Angeles California
    It does not work. Cpanel directory does not allow you to include PHP files like you normally do.

    You have to include then in the PHP library.
    Try it out and you will see what I mean

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. SoftmegUK

    SoftmegUK Well-Known Member

    Joined:
    Feb 13, 2002
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    316
    Location:
    UK

    Oh yeah sorry my mistake! Been a long time since I wrote my theme for cPanel!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice