Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
--
-- Структура на таблица `login_stats`
--
CREATE TABLE `login_stats` (
`id` int(100) NOT NULL auto_increment,
`user` varchar(255) NOT NULL,
`date` varchar(255) NOT NULL,
`chas` varchar(255) NOT NULL,
`ip` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ;
// Статистика за посещение
$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
$user = "$username";
$today1 = getdate();
$month = $today1[mon];
$mday = $today1[mday];
$year = $today1[year];
$today = date( "H:i" );
$cur_date = $mday . "-" . $month . "-" . $year;
$send = mysql_query("INSERT INTO login_stats (user, date, chas, ip)
VALUES('$user', '$cur_date', '$today', '$REMOTE_ADDR')")
or die(mysql_error());
// Край Статистика
<?
$sql = mysql_query("SELECT * FROM login_stats ORDER BY id DESC LIMIT 20") or die(mysql_error());
echo "<b><table align=\"center\" width=\"96%\" border=\"0\" cellspacing=\"1\"
cellpadding=\"3\" bgcolor=\"#003399\" >
<tr align=\"center\">
<td width=\"5%\">№</td>
<td>Потребител:</td>
<td>IP:</td>
<td>Дата:</td>
<td>Час:</td>
</tr>";
while($res = mysql_fetch_array($sql))
{
echo ("<tr>
<td>$res[id]</td>
<td>$res[user]</a></td>
<td>$res[ip]</a></td>
<td align=\"center\">$res[date]</td>
<td align=\"center\">$res[chas]</td>
</tr>");
}
echo "</table></b>";
?>