Malaysian WackWall Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Malaysian WackWall Forum

Now Malaysian Can Connect Over The World
 
HomePortalGalleryLatest imagesSearchRegisterLog in
Navigation
:: Portal ::
:: Forum ::
 :: Memberlist ::
:: Profile ::
:: FAQ ::
:: Search ::


AlertPay Easy Money Transfer 100% Free to register
 
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Google Translator
Latest topics
» IRC Flooder Script For Sale
[PHP] System Log Web EmptyMon Oct 08, 2012 12:39 am by maxi.y.mateo

» utusan.com.my Being DDOS
[PHP] System Log Web EmptyFri Jan 20, 2012 5:33 pm by Penjejak Badai

» PHP IRC Bot
[PHP] System Log Web EmptyFri Dec 02, 2011 11:31 am by siperda

» SQL Injection Scanner By XShimeX
[PHP] System Log Web EmptyMon Oct 24, 2011 6:22 pm by sucide_bomber

» Website Vulnerable Scanner Tools V1.01 By proqrammer
[PHP] System Log Web EmptyMon Oct 24, 2011 6:21 pm by sucide_bomber

» Slowloris or XerXes Leak Version
[PHP] System Log Web EmptyTue Sep 13, 2011 7:45 pm by sucide_bomber

» maisarah wuz here
[PHP] System Log Web EmptyTue Sep 13, 2011 7:32 pm by sucide_bomber

» Sql Injection Tutorial
[PHP] System Log Web EmptyTue Jul 19, 2011 2:56 pm by sucide_bomber

» XerXes Source Codes!!
[PHP] System Log Web EmptyWed Jul 13, 2011 8:55 am by wackwall

» SQL Injection dalam bahasa Malaysia
[PHP] System Log Web EmptyThu Jun 30, 2011 9:11 pm by sucide_bomber

» LFI Scanner ( Perl )
[PHP] System Log Web EmptyMon Jun 27, 2011 8:21 am by wackwall

» Muhasabah diri tingkat kesyukuran, keinsafan umat
[PHP] System Log Web EmptyMon Jun 27, 2011 3:56 am by sucide_bomber

» 5013 Webs With SQL Vuln
[PHP] System Log Web EmptyMon Jun 27, 2011 3:50 am by sucide_bomber

» Saya mencari part time job online?
[PHP] System Log Web EmptyMon Jun 27, 2011 1:19 am by sucide_bomber

» 16 exploits for hacking CC databases
[PHP] System Log Web EmptyMon Jun 13, 2011 1:33 pm by sucide_bomber

Link Exchange
Online News


















Churp2x Campaign
Click Pada Iklan DiBawah & Dapatkan Ganjaran Anda
SEKARANG!



















Mangga Ads
NuffNang Ads

 

 [PHP] System Log Web

Go down 
AuthorMessage
wackwall
Admin
wackwall


Zodiac : Cancer Chinese zodiac : Rooster
Posts : 159
Points : 5338
Reputation : 2
Join date : 10/12/2010
Age : 42
Location Location : Sarawak

[PHP] System Log Web Empty
PostSubject: [PHP] System Log Web   [PHP] System Log Web EmptyTue Apr 05, 2011 10:02 am

Untuk tujuan pembelajaran,

hari ini saya nak kongsi satu script php untuk system log web. fungsinya ala2 logger but not keyloggers.. dengan adanya script ini kita akan tahu apa yang user tengok, post, ip dorang, browser.

Mari mulakan:


Code:
<?php
$agent = $_SERVER['HTTP_USER_AGENT'];
$uri = $_SERVER['REQUEST_URI'];
$ip = $_SERVER['REMOTE_ADDR'];
$ref = $_SERVER['HTTP_REFERER'];
$proxy = $_SERVER['HTTP_X_FORWARDED_FOR'];
$via = $_SERVER['HTTP_VIA'];
$dtime = date('r');
$entry_line =
"
//--------------------------- //
Masa: $dtime
IP: $ip
Browser: $agent
URL: $uri
Referrer: $ref
Proxy: $proxy
Koneksi: $via
//--------------------------- //
";
$fp = fopen("log.txt", "a");
fputs($fp, $entry_line);
fclose($fp);
?>

Then save it as log.php


Explaination:

$_SERVER merupakan variables yang dihasilkan oleh web server. So semua variables yang berhubung dengan pelayan server contohnya untuk mengetahui alamat “IP Host” dan “Nama Host”.


$_SERVER['HTTP_USER_AGENT']; digunakan untuk melihat type Browser

$_SERVER['REQUEST_URI']; digunakan untuk mengetahui script ini disimpan ( file log.php yang kita buat tadi ).

$_SERVER['REMOTE_ADDR']; digunakan untuk melihat IP pengunjung.

$_SERVER['HTTP_REFERER']; digunakan untuk mengetahui script ini di referer dimana.

$_SERVER['HTTP_X_FORWARDED_FOR']; Untuk melihat jika ada proxy digunakan oleh pengunjung.

$_SERVER['HTTP_VIA']; Untuk melihat connection pengunjung.

$dtime = date(‘r’; Ini untuk Tarikh.

Variable $entry_line merupakan deskripsinya. Setelah itu server akan create file "log.txt" dengan fungsi fopen() dan dengan fungsi fputs() akan menyalin isi dari variable $entry_line didalamnya. Untuk “a” itu berfungsi apabila log.txt belum dicreate, jadi log.txt akan dibuat secara automatik. Tutup file dengan fclose().


Jika ada penambahan daripada pakar2 php atau abang/kakak yang terer dalam php.. sila bagi tunjuk ajar. Jika terdapat kesalahan dalam tutorial saya ini, sila perbetulkan.


Thanks,

wackwall
Back to top Go down
https://malaysia.1talk.net
 
[PHP] System Log Web
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Malaysian WackWall Forum :: Internet :: Web Application :: Scripts-
Jump to: