linkedin facebook linkedin facebook nod32

Php da saytga murojaatlar soni

Muallif: Mengliyev SH.

Qo`shilgan sana: 2014-09-19

Saytga murojaatlar soni

PhpMyAdmin da online baza yaratib olamiz

jadvalval ko`rinishi qo'yidagicha (rasm 1 da).

1-rasm

Index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Saytga murojaat</title>
</head>

<body>

<?php

function online () {
$ip=getenv("HTTP_X_FORWARDED_FOR");
if (empty($ip) || $ip=='unknown') { $ip=getenv("REMOTE_ADDR"); }


$select = mysql_query ("SELECT ip FROM online WHERE ip='$ip'") or die ("Can't select duble");
$tmp = mysql_fetch_row ($select);
if ($ip == $tmp[0]) {
mysql_query ("UPDATE online SET time=NOW() WHERE ip='$ip'") or die ("Can't update");
}

else

{
mysql_query ("INSERT INTO online (ip,time) VALUES ('$ip',NOW())") or die ("Can't insert");
}

$select = mysql_query ("SELECT COUNT(*) FROM online") or die ("Can't select result");
$tmp = mysql_fetch_row ($select);
$result = $tmp[0];

return $result;
}

echo "<p> Saytga murojaat jami: ".online()."</p>";



?>

</body>
</html>

2003 marta o`qildi.

Parol:
Eslab qolish.


Ro`yhatdan o`tish

testing

+998915878681

Siz o`z maxsulotingizni 3D reklama ko`rinishda bo`lishini xohlaysizmi? Unda xamkorlik qilamiz.

3D Reklama


Рейтинг@Mail.ru
Рейтинг@Mail.ru

Besucherzahler
счетчик посещений