<<< Any Website Developers here?? i need help!!>>

Status
Not open for further replies.

panacea_amc

CBZ is better than Pulsar
hello people,
i am a newbie to this website buisness. i am setting up a website for my personal use. its = *panacea.3-hosting.net

my purpose is ONLY to tack the I.P. address of the visitors to my website. si there any specific software for this purpose?

in my site, i have da following folders and files.:
1.sns_collector = folder
2. images = folder
3 index.html = file....

please help me how to proceed?? thanx!!!
 
OP
panacea_amc

panacea_amc

CBZ is better than Pulsar
ya....it supports php..but i m a complete newbie nad dont know anything abt writing code.....plz kindly tell me where to write code.....and then how can i know the ip address....

thnx
 

ahref

In the zone
Write this in text file, name it ipadd.php
<?php
print $_SERVER["REMOTE_ADDR"];
?>
upload it on your server, then open it in browser.
 

ajayashish

Living to Succeed
ahref said:
Write this in text file, name it ipadd.php
<?php
print $_SERVER["REMOTE_ADDR"];
?>
upload it on your server, then open it in browser.

What this really helps in
 

Ricky

Cyborg Agent
will print IP address of the client opening the page.


Btw, you first buy a PHP book and read it for a month .. you wil really love it then.
 
OP
panacea_amc

panacea_amc

CBZ is better than Pulsar
Thank u Ahref for the code......the code displayed the i.p. address of the visitors to my site........now if i want to know the ip addresses of those visitors, how is that possible?....does this data get stored in my site(server) or somewhere else?????

thanx agagin.....
 
OP
panacea_amc

panacea_amc

CBZ is better than Pulsar
thanks Ahref again, but can u kindly mention the steps of storing the data thru scripting or as a text file...???
i believe thnx will not b enuf for u .
thnx again!!
 

Choto Cheeta

Rebooting
well there are 3rd party techniques to get that data,

one is, *www.statcounter.com

there it will give u a code which u have to place at ur pages, that code may be invisible or visible as a counter of ur page views, after u place the code in ur site u can get Stats from the stat counter control panel...

or many hosting comes with web stat software such as webziller... look for a Stats in ur hosting panel...

what software u r using ?? cPanel ??
 

anilmail17

Journeyman
PHP:
<?php 
$fp=fopen("ipstat.txt","a+");
$fwrite($fp,date('Y-m-d H:i:s').$_SERVER["REMOTE_ADDR"]."\n");
fclose($fp);
?>
then read the ipstat.txt from your control panel or web browser
 

ajayashish

Living to Succeed
can we have any alternate to see without going in control panel and seeing the TXT

like echoing the txt file on a html page
 

desertwind

Cyborg Agent
of course you have.

Code:
<?php

$fp=fopen("ipstat.txt", "r");

while ( $line = fgets($fp, 1000) ) {
print $line;
}

fclose($fp);

?>

save this file as stats.php and open in your browser.
 
Last edited:
OP
panacea_amc

panacea_amc

CBZ is better than Pulsar
guys!!! please wait....u must be some gurus in programming...but i a newbie

where is the "ipstat.txt" file??? wht is the control panel??? i am not unerstanding these things>>>>

i i want to know who r visiting my site ONLINE.....please explain the steps elaboratley....thanks buddys!!
 
Last edited:

kalpik

In Pursuit of "Happyness"
ipstat.txt file will be created automatically.. And forget about control panel.. just type *panacea.3-hosting.net/ipstat.txt to view the IPs.
 

desertwind

Cyborg Agent
Well, your question is answered already in this thread. For your sake repeating again.

1. Rename your index.html (or index.htm) to index.php
2. Put the following code just after the <body> tag
Code:
 <?php 
$fp=fopen("ipstat.txt","a+");
$fwrite($fp,date('Y-m-d H:i:s').$_SERVER["REMOTE_ADDR"]."\n");
fclose($fp);
?>
3. Create a new page stats.php and insert the following after the <body> tag
Code:
<?php

$fp=fopen("ipstat.txt", "r");

while ( $line = fgets($fp, 1000) ) {
print $line;
}

fclose($fp);

?>
4. Open www.yoursite.com/stats.php for the status
5. Voila!

Pretty simple isn't it ?
 
Status
Not open for further replies.
Top Bottom