How to make a who's online with php script - sometimes to know who and where only those who are online at the website is very necessary. It can be used as a tool to control or manage a website.
That way we will more easily detect and control the descending and rising visitor traffic on our personal web. Actually, make that sort of thing is not too difficult, just need patience and perseverance to mempelajarinnya.
Let the reader happy, let us together try to learn to apply what I have said above. The first step we have to do to make who is online is to create a script that runs as a whos-online. This can be named as whos-online.php.
<?php require_once("Settings.php"); // begin whos-online login check $passed_login = false; if ($C['enable_password_protect']) { $passed_login = process_login(); } // This code MUST be placed after your Settings.php is included and before anything has printed. // PHP cannot set cookies after anything has printed, or you get an error: "headers already sent". // end whos-online login check require_once("common.php"); ############################################################################ $TITLE= $SITE['organ'] . " - Who's Online"; $showGizmo = true; // set to false to exclude the gizmo include("top.php"); ############################################################################ ?> <!-- begin whos online page header code --> <?php check_for_settings(); if( isset($_GET['refresh']) && is_numeric($_GET['refresh']) ){ $query = 'refresh='. $_GET['refresh']; if( isset($_GET['show']) && $_GET['show'] != '') { if ( $_GET['show'] == 'all' || $_GET['show'] == 'bots' || $_GET['show'] == 'guests' ){ $query .= '&show='. $_GET['show']; } } if( isset($_GET['bots'])) { $query .= '&bots=1'; } echo '<meta http-equiv="refresh" content="' . $_GET['refresh'] . ';URL=' . $C['filename_whos_online'] . '?' . $query . '" /> '; } ?> <script type="text/javascript" language="JavaScript"> <!-- function who_is(url) { window.open(url,"who_is_lookup","height=650,width=800,toolbar=no,statusbar=no,scrollbars=yes").focus(); } //--> </script> <!-- end whos online page header code --> </head> <body> <?php ############################################################################ include("header.php"); ############################################################################ include("menubar.php"); ############################################################################ ?> <div id="main-copy"> <h1>Who's Online</h1> <?php include($C['files_path'].'include-whos-online-page.php'); ?> <?php $map_settings = array( // html map settings // set these settings as needed 'time' => '15', // digits of time 'units' => 'minutes', // minutes, hours, or days (with or without the "s") 'map' => $C['default_map'], // 1,2 3, etc. (you can add more map images in settings) 'pin' => '1', // 1,2,3, etc. (you can add more pin images in settings) 'pins' => 'off', // off (off is required for html map) 'text' => 'on', // on or off 'textcolor' => '000000', // any hex color code 'textshadow' => 'FFFFFF', // any hex color code 'textalign' => 'cb', // ll, ul, lr, ur, c, ct, cb (codes for: lower left, upper left, upper right, center, center top, center bottom) 'ul_lat' => '0', // default 0 for worldmap 'ul_lon' => '0', // default 0 for worldmap 'lr_lat' => '360', // default 360 for worldmap 'lr_lon' => '180', // default 180 for worldmap 'offset_x' => '0', // + or - offset for x axis - moves pins left, + moves pins right 'offset_y' => '0', // + or - offset for y axis - moves pins up, + moves pins down 'type' => 'png', // jpg or png (map output type) ); echo get_whos_online_worldmap($map_settings); ?> <br /> <a href="whos-online.php">Who's Online</a> <br /> <a href="whos-been-online.php">Who's Been Online</a> <br /> <a href="whos-online-maps.php">Visitor Maps</a> </div><!-- end main-copy --> <?php ############################################################################ include("footer.php"); ############################################################################ # End of Page ############################################################################ // end of file
DOWNLOAD HERE | DEMO
Once you have finished the script that you can instantly create another script which is also very important. For this reason this script is necessary to support the other script. From the dizzy please download everything in full here.
Keyword search : make php script executable, how to make a php script run automatically, creating a php script, where to put php script, php build script.
0 komentar:
Posting Komentar