Premium Membership
Subscription graphics design php html youtube
Gold Subscription with Silver access
graphics design php html youtube
Live Support
Contact us by live help [photoshop, website design, tutorials]
Not available on weekends
Nuke Statistics to HTML



This tutorial is to help those who have searched so long to find a way to include php nuke statistics (number of member, total hits, forum posts, downloads and much more) into a html document. It is actually quite easy once you have a basic knowledge of php and html but fear not, this tutorial is also for people with little or no knowledge of php, html and MySql.

:: Tutorial ::
Create a blank php file, this can easily be done in Dreamweaver from the File>New menu. Insert your php tag ( <?php ) then the first thing to add is ( require_once("mainfile.php"); ). This has your database log-in info so instead of writing your user name and passwords, you just include that file. Next it's time to start adding the stats you need, for this tutorial I will use the page hits. To gather that information you need to query the tables in your database. We do that by using this query .....

$sql = "SELECT count FROM ".$prefix."_counter WHERE type='total' AND var='hits'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $pageview = "Total Hitz $row[0] "; 

Next we need to echo the result, we do that by adding this last bit of code.

echo "<left><font color=\"FF0000\" size=\"9\"><b>$pageview</b></font><br>";

Close your php tag.. ?>. Your php file should look like the following.

<?php
require_once("mainfile.php");
$sql = "SELECT count FROM ".$prefix."_counter WHERE type='total' AND var='hits'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $pageview = "Total Hitz $row[0] "; 
echo "<left><font color=\"FF0000\" size=\"9\"><b>$pageview</b></font><br>";
?>

Save the php page to your nuke root directory, this is the same folder as your config.php and mainfile.php. The final step is to include the file in your html page. Open your html file and use a php include like the following.

<? include("http://yoursite.com/nuke/name of your php file"); ?>

That's it, you are all done. If you need further help please post inside our forums.



Advertisement





New Subscribers



Subscriber

CubanoSiempre

Platinum Subscribers

#1
Subscriber

chefjustinh

Silver Subscribers

#2
Subscriber

ballistique

Silver Subscribers

#3
Subscriber

xplan

Silver Subscribers

#4
Subscriber

kenno

Ultimate Subscriber

#5




Our Sponsors



PHP Nuke themes, stock photos, icons, drupal themes and more.
Custom jobs at low cost, free lancers and service buyers.
Free e Cards of holidays, cute animals, nature and more
Advertise with Western Studios.net


Downloads



Latest in downloads

Most downloaded


Jobs





Community

Western Studios is an award winning website creating website disign and professional php scripts.

Associated Sites

Marketplace Themes, scripts, icons and images

Themes site PHP Nuke themes preview site.