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.

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:
    16
    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:
    36
    Not really possible since cPanel runs its own web server for WHM & cPanel.

    cPanel.net Support Ticket Number:
     
  3. Faldran

    Faldran Well-Known Member

    Joined:
    May 28, 2002
    Messages:
    136
    Likes Received:
    0
    Trophy Points:
    16
    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:
    495
    Likes Received:
    0
    Trophy Points:
    16
    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.

     
  5. SoftmegUK

    SoftmegUK Well-Known Member

    Joined:
    Feb 13, 2002
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    16
    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 :)
     
  6. Roy@ENHOST

    Roy@ENHOST Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    495
    Likes Received:
    0
    Trophy Points:
    16
    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

     
  7. SoftmegUK

    SoftmegUK Well-Known Member

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

    Oh yeah sorry my mistake! Been a long time since I wrote my theme for cPanel!
     
Loading...

Share This Page