Jump to content

to integrate this code on HTML?


hostingames

Recommended Posts

hi,

 

need help thank you

 

to integrate this code on HTML?

 

$counter3 = mysql_query("SELECT COUNT(*) AS id FROM tblhosting WHERE domainstatus='Active'");
$num3 = mysql_fetch_array($counter3);
$count3 = $num3["id"];
$this->assign('hostingtotal',$count3); 

 

 

on my page header.tpl the code works well.

index.html fontionne not

Link to comment
Share on other sites

There would be two ways to do that.

 

1. To execute php code in html, you will need to put this code in your .htaccess file.

AddType application/x-httpd-php .html .htm

 

or

 

2. You can execute the code in php file and include it in html via iframe.

Link to comment
Share on other sites

@hostingames, simply create activeClients.php inside your WHMCS main directory and place this code inside it:

<?php
require("init.php");
$counter3 = mysql_query("SELECT COUNT(*) AS id FROM tblhosting WHERE domainstatus='Active'");
$num3 = mysql_fetch_array($counter3);
$count3 = $num3["id"];
echo "document.write('{$count3}');";
?>

 

in index.html you use the following code to display the result from activeClients.php file:

<script type="text/javascript" src="http://yourwebsite.com/whmcs/activeClients.php"></script>

 

this will do what you need

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated