360haven works best with JavaScript enabled
PHP Page counter and page loadtime without MYSQL/MSSQL
Loading
Register
Login
Results 1 to 6 of 6
  1. #1
    Senior Member
    ohnoyekoms is offline
    Join Date : Apr 2012
    Posts : 103
    Array

    PHP Page counter and page loadtime without MYSQL/MSSQL

    For this you'll need two .php files, one called loadtime, and load show. once you create loadtime.php drop this snippet within it..


    <?
    $time = microtime();
    $time = explode(" ", $time);
    $time = $time[1] + $time[0];
    $start = $time;

    $count_my_page = ("views");
    $hits = file($count_my_page);
    $hits[0] ++;
    $fp = fopen($count_my_page , "w");
    fputs($fp , "$hits[0]");
    fclose($fp);
    ?>


    then you'll create loadshow.php which shows how long it took your server to load and process the page. so lets get to the snippet.

    <?
    $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $finish = $time; $totaltime = ($finish - $start); printf ("<center><font color=white face=Verdana size=1>loaded in %f/ms. and $hits[0] views.</center>", $totaltime);
    ?>


    so now we have the php files required for this. okay lets begin.

    on the page you want to show a load time, at the top of the page, put <? include('loadtime.php'); ?> this will start the counter, it will also add a number to the page visit counter. then at the bottom right above your </html> put, <? include('loadshow.php'); ?> this will print out the load time.



    and thats pretty much it. depending on where you put loadshow.php is where it quits the timer.
    Downloads : 14 || Uploads : 0 || Rep Power : 2401 || Posts : 103 || Thanks : 20 || Thanked 40 Times in 16 Posts


    Need file hosting? go here


  2. The Following 2 Users Say Thank You to ohnoyekoms For This Useful Post:


  3. #2
    The Immortal God
    Rpg_Fan

    CloudStrife7x is offline
    Join Date : Dec 2010
    Location : Unknown
    Age : 30
    Posts : 18,755
    Array
    Twitter: @

    Re: PHP Page counter and page loadtime without MYSQL/MSSQL

    another great share bro :)
    Downloads : 157 || Uploads : 0 || Rep Power : 22363 || Posts : 18,755 || Thanks : 4,451 || Thanked 3,096 Times in 2,607 Posts



  4. #3
    Retired Staff

    thegutta is offline
    Join Date : Jun 2011
    Location : On Top Of The World
    Posts : 10,473
    Array
    Twitter: @
    Quote Originally Posted by CloudStrife7x View Post
    another great share bro :)
    Yup another great share you got the right cloud but the thing is i have no idea what he's talking about lol but i guess some people will n they will love it whatever the is lol
    Downloads : 47 || Uploads : 0 || Rep Power : 13396 || Posts : 10,473 || Thanks : 3,231 || Thanked 1,396 Times in 1,224 Posts




  5. #4
    Senior Member
    ohnoyekoms is offline
    Join Date : Apr 2012
    Posts : 103
    Array

    Re: PHP Page counter and page loadtime without MYSQL/MSSQL

    thegutta, you can view a demo on the file hosting site, goto the main haven page, click the upload button on the right hand side, it'll load a page, goto the bottom and you'll see a load time and visits. thats my site running that exact code :P
    Downloads : 14 || Uploads : 0 || Rep Power : 2401 || Posts : 103 || Thanks : 20 || Thanked 40 Times in 16 Posts


    Need file hosting? go here


  6. The Following User Says Thank You to ohnoyekoms For This Useful Post:


  7. #5
    Retired Staff

    thegutta is offline
    Join Date : Jun 2011
    Location : On Top Of The World
    Posts : 10,473
    Array
    Twitter: @
    Quote Originally Posted by ohnoyekoms View Post
    thegutta, you can view a demo on the file hosting site, goto the main haven page, click the upload button on the right hand side, it'll load a page, goto the bottom and you'll see a load time and visits. thats my site running that exact code :P
    Ohhhh lol yeah i see it i get it now lol great info ohnoyekoms thanks for speaking my language now :-D
    Last edited by thegutta; 05-14-2012 at 10:39 PM.
    Downloads : 47 || Uploads : 0 || Rep Power : 13396 || Posts : 10,473 || Thanks : 3,231 || Thanked 1,396 Times in 1,224 Posts




  8. #6
    Senior Member
    ohnoyekoms is offline
    Join Date : Apr 2012
    Posts : 103
    Array

    Re: PHP Page counter and page loadtime without MYSQL/MSSQL

    you're welcome, live examples work better then explaining things :D
    Downloads : 14 || Uploads : 0 || Rep Power : 2401 || Posts : 103 || Thanks : 20 || Thanked 40 Times in 16 Posts


    Need file hosting? go here


 

 

Similar Threads

  1. Signing In on the home page question
    By evilhotice in forum General Discussion
    Replies: 0
    Last Post: 03-02-2014, 11:07 PM
  2. just got big warning page?
    By voidmage09 in forum General Discussion
    Replies: 6
    Last Post: 03-14-2012, 06:12 PM

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

About 360haven

    360haven is an Forum Devoted To Game modding Fans from all over the world.

    An Awesome Community of Xbox 360 Gamers, Modders and Developers who Create & Share Tutorials, Applications, Gfx, Trainers and Gamesaves.

    A haven for the l33t.
    A scarce paradise for modders.

Like this page

Google+