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



## panacea_amc (Jan 14, 2007)

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!!!


----------



## ahref (Jan 14, 2007)

tracking ip address is one line php code, do your server support php?


----------



## panacea_amc (Jan 14, 2007)

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 (Jan 14, 2007)

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 (Jan 14, 2007)

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 (Jan 14, 2007)

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.


----------



## panacea_amc (Jan 15, 2007)

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.....


----------



## ahref (Jan 15, 2007)

You have to store the data, through script. You can store it table or text file.


----------



## panacea_amc (Jan 15, 2007)

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 (Jan 15, 2007)

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 ??


----------



## ajayashish (Jan 15, 2007)

statcounter is a better option


----------



## anilmail17 (Jan 15, 2007)

```
<?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 (Jan 15, 2007)

where to write this code


----------



## desertwind (Jan 15, 2007)

rename your index.html as index.php

then write this code inside the <body></body> tag.


----------



## ajayashish (Jan 15, 2007)

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 (Jan 15, 2007)

of course you have.


```
<?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.


----------



## ahref (Jan 15, 2007)

Great, complete program has been developed.


----------



## panacea_amc (Jan 15, 2007)

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!!


----------



## kalpik (Jan 15, 2007)

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 (Jan 15, 2007)

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

```
<?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

```
<?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 ?


----------



## panacea_amc (Jan 16, 2007)

thank you people for bearing with me, especially Desertwind: thanx buddy, ur too good!!
thanx all n keep this forum rocking!!
__________
some more querries:::

i managed to get the I.P. address of my fren live chatting. he was from barelli..but when i used his i.p.to find out the location (city)...it showed bangalore....i used *www.geobytes.com/IpLocator.htm?GetLocation
for findin the location.....is there any way of 100% effective correct reporting of the location concerned?

thnx again


----------



## Ricky (Jan 17, 2007)

No , there is no 100% way to get accurate information untill the user is having static IP .

If your free hosting provide you cPanel or any other panel then you shld have some stats program already installed under it.


----------



## sude (Jan 17, 2007)

i am talking something out of the post query... i am sorry

dear panacea ur site seems interesting but why are u using 3-hosting... that to with ads... move to 110mb.com no ads adn fully professional features...

go to www.110mb.com for more

-SUDE


----------



## panacea_amc (Jan 17, 2007)

hey sude, u said u found my site interesting!!! 
I had only ONE thing in my site and that was......

Well....m i rite in guessing???

Ok. I will check out 110mb.com


----------



## tuxfan (Jan 18, 2007)

ax3 said:
			
		

> thanx 4 this info ........ php is indeed great ......... any good book ?


Plenty of them. But you will surely find e-books  Search for them is all I can say openly  

But also get hold of a copy of php manual from www.php.net. If you know C/C++/Java then you will feel at home in PHP. The basic syntax, loops, etc. is same.


----------



## toofan (Oct 6, 2008)

Good advance PHP books really needed. Please can anyone Post the names of Best books on PHP.


----------



## furious_gamer (Oct 6, 2008)

toofan_nainital said:


> Good advance PHP books really needed. Please can anyone Post the names of Best books on PHP.



What r u doin in old thread... Making digit forum organised and uncluttered?


----------



## Garbage (Oct 6, 2008)

lol... He bumped a year old thread...


----------



## Faun (Oct 6, 2008)

^^lol you are third


----------



## toofan (Oct 6, 2008)

Actually there are very few members comming to the programming section so very few threads compared to other sections. I started reading the threads from the last page. And I find some really interesting so I bumped them to make them live again.

But I need Good PHP books with some advance programming.


----------

