Results 1 to 5 of 5

Thread: How do i run php code that i made on cpanel branding index.html file?

  1. #1
    Member
    Join Date
    Jan 2010
    Posts
    9

    Default How do i run php code that i made on cpanel branding index.html file?

    hello i made a php script and was wondering how i could run the following on the interface of cpanel what it does is it check to see if the domain name exists in my whmcs if so then displays links if not then the account is not owned by me and must be owned by a reseller and will not show!

    <?PHP
    $whmcsconnect = mysql_connect("localhost","fruity_root","kaydenhill_1992") or die(mysql_error());

    if ($whmcsconnect)
    {
    mysql_select_db("fruity_billing",$whmcsconnect) or die(mysql_error());
    $whmcsquery = "SELECT * COUNT(domain) FROM tblhosting WHERE domain='ryantest.fruitywebhost.com'";

    $whmcsresult = mysql_query($whmcsquery) or die(mysql_error());

    if (mysql_affected_rows()==1)
    {

    ?>
    <cpanel Branding="include(whmcsgold_cpanel.html)">
    <?PHP
    }
    }
    ?>



    How do i get this to run?

  2. #2
    Member
    Join Date
    Jan 2010
    Posts
    9

    Default

    any ideas?

  3. #3
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,562
    cPanel/WHM Access Level

    DataCenter Provider

    Lightbulb

    I recommend reviewing the following threads for ideas and methods detailing how to accomplish using custom PHP code within a customized theme:
    Adding rows to stat.html with data gathered by PHP script. - cPanel Forums
    cp includes: possible to include a php file? - cPanel Forums
    Execute PHP in branded index page (stats) - cPanel Forums

    Please also reference the following documentation for additional clarification: Using PHP in the cPanel Interface

  4. #4
    Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    Rename index.html to index.php, it should execute. If it isn't redirecting to index.php properly, please let me know here (PM will suffice), then do a redirect in teh index.html file.
    Matt Dees

  5. #5
    Member
    Join Date
    Jan 2010
    Posts
    9

    Default

    Sorry this method is not working. is thier any other way i can do it, the php code is only an if or else statement.

Similar Threads

  1. How do i run php code that i made on cpanel branding index.html file?
    By littohouston in forum Themes and Branding
    Replies: 1
    Last Post: 01-06-2010, 04:06 PM
  2. Help with uploading html code on cpanel file manager
    By frances in forum New User Questions
    Replies: 2
    Last Post: 08-08-2009, 03:28 PM
  3. want to switch hom page from index.html to index.php
    By websoftbiz in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 07-12-2008, 07:14 PM
  4. cPanel Branding Made Easy.
    By alaria in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 02-18-2004, 05:09 PM