Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 24-02-2007, 07:28 PM   #1 (permalink)
~[::BOoYaKa::]~
 
Join Date: May 2005
Location: In a Cave.
Posts: 575
Default php code needed


can someone tell me the php code to know the last page of the visitor, i.e. from where the visitor came?? and writes every info about the visitor in a text file!!??
Can anyone help me?
Thanx.
__________________
[::Eddie n Benoit Live Forever::]
REY619 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 24-02-2007, 10:09 PM   #2 (permalink)
In The Zone
 
bukaida's Avatar
 
Join Date: Jul 2005
Location: KOLKATA
Posts: 267
Default Re: php code needed

problem is not very clear. Do you want to track the ip address, time of visit , number of visit etc information of the visitor?
__________________
Desktop: P-IV 2.4GHz, 512MB DDR, 865GBF Mother Board,
G-Force 5200FX, 17" Samsung flat, WinXp with SP2,
Kaspersky Internet Security 2009.
Laptop:LENOVO 3000 C100 D7 lappy with 2GB DDR2.
bukaida is offline  
Old 24-02-2007, 10:14 PM   #3 (permalink)
String Phreak
 
mediator's Avatar
 
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
Default Re: php code needed

thats very easy. But instead of file u shud use mysql!
http://www.plus2net.com/php_tutorial/php_ip.php
http://www.w3schools.com/php/php_file.asp
__________________
Bad Bad server.....No candy for u!
mediator is offline  
Old 24-02-2007, 11:11 PM   #4 (permalink)
Rebooting
 
Choto Cheeta's Avatar
 
Join Date: Aug 2004
Location: 220.225.82.33
Posts: 6,266
Default Re: php code needed

well in that case all best hosting comes with softwares like AWStats which doo all this job for u very professionally

also if not, then u still can use Statcounter

__________________
rebooting
ChotoCheeta.com
Choto Cheeta is offline  
Old 25-02-2007, 05:00 PM   #5 (permalink)
~[::BOoYaKa::]~
 
Join Date: May 2005
Location: In a Cave.
Posts: 575
Default Re: php code needed

Hmm well look at this::
Code:
<?php
session_start();
if($_SESSION["logged"] != "yes")
{
$agent = $_SERVER['HTTP_USER_AGENT'];
$uri = $_SERVER['REQUEST_URI'];
$ip = $_SERVER['REMOTE_ADDR'];
$ref = $_SERVER['HTTP_REFERER'];
$visitTime = date("r"); //Example: Thu, 21 Dec 2000 16:01:07 +0200


$logLine = "$visitTime - IP: $ip || User Agent: $agent || Page: $uri || Referrer: $ref\n";
$fp = fopen("visitorLog.txt", "a");
fputs($fp, $entry_line);
fclose($fp);
$_SESSION["logged"] = "yes";
}
?>
According to this code it should write the information about the visitor in the file visitorLog.txt but it doesnt write anything to it. Both this php file visitorLog.txt are in the same directory, and i have chmodded visitorLog.txt to 777 too, but still it is blank...
Does anybody know, where is the error?/ Thanx.
__________________
[::Eddie n Benoit Live Forever::]
REY619 is offline  
Old 25-02-2007, 05:05 PM   #6 (permalink)
TechTin.com
 
ravi_9793's Avatar
 
Join Date: Jun 2005
Location: www.TechTin.com
Posts: 4,090
Default Re: php code needed

I think the best suggestion is of saurav_cheeta ..
http://www.statcounter.com/

I am using this..it is simple n great.
ravi_9793 is offline  
Old 25-02-2007, 05:30 PM   #7 (permalink)
eWebGuru
 
ahref's Avatar
 
Join Date: Mar 2006
Location: Dehradun
Posts: 427
Default Re: php code needed

@REY619 you are storing the data in $logLine and writing $entry_line, use same variable at both place.
__________________
Windows and linux hosting at http://www.ewebguru.com
Get $50 per blog post PM me for details.
ahref is offline  
Old 25-02-2007, 08:22 PM   #8 (permalink)
~[::BOoYaKa::]~
 
Join Date: May 2005
Location: In a Cave.
Posts: 575
Default Re: php code needed

Damn!! How did i missed that??!! Thank you HyperReference
__________
its working now, thanx
__________________
[::Eddie n Benoit Live Forever::]

Last edited by REY619; 25-02-2007 at 08:22 PM. Reason: Automerged Doublepost
REY619 is offline  
Old 25-02-2007, 10:12 PM   #9 (permalink)
In The Zone
 
Join Date: Oct 2004
Posts: 437
Default Re: php code needed

Quote:
Originally Posted by ravi_9793
I think the best suggestion is of saurav_cheeta ..
http://www.statcounter.com/

I am using this..it is simple n great.
but should also list it is not free for pro use..only keeps logs on last 100 users and always lures u to buy thier paid version...
nice for small and non pro sites...only .Their free version..
__________________
be who u r :
Saharika is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Piyush
- by icebags
- by clinton
- by Charan

Advertisement




All times are GMT +5.5. The time now is 12:05 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2