Welcome to Gaia! ::


If anyone could tell me a free program that let me program php on it, please tell me.

Oh and I need the code that saves me the Ip address that the user used to enter my web page.
Wordpad will let you do that.
Ultraedit and Textpad are good text editors you can use.

The ip is stored in the server variable $_SERVER['REMOTE_ADDR'], and you can use the GetHostByName() to lookup the name.
Well, you can write PHP in any plain text editor...a la Notepad.

As for the code, gimme a few minutes as I don't know how to do this off the top of my head.

Rannos
ScareTrolfey
Ultraedit and Textpad are good text editors you can use.

The ip is stored in the server variable $_SERVER['REMOTE_ADDR'], and you can use the GetHostByName() to lookup the name.
But could I actually save the Ip on my computer or something?
crazy_guy27
ScareTrolfey
Ultraedit and Textpad are good text editors you can use.

The ip is stored in the server variable $_SERVER['REMOTE_ADDR'], and you can use the GetHostByName() to lookup the name.
But could I actually save the Ip on my computer or something?
well if you can get the ip then you can save the ip ... in alot of diffrent ways
grundal
crazy_guy27
ScareTrolfey
Ultraedit and Textpad are good text editors you can use.

The ip is stored in the server variable $_SERVER['REMOTE_ADDR'], and you can use the GetHostByName() to lookup the name.
But could I actually save the Ip on my computer or something?
well if you can get the ip then you can save the ip ... in alot of diffrent ways
Your siggy doesn't... right?
crazy_guy27
grundal
crazy_guy27
ScareTrolfey
Ultraedit and Textpad are good text editors you can use.

The ip is stored in the server variable $_SERVER['REMOTE_ADDR'], and you can use the GetHostByName() to lookup the name.
But could I actually save the Ip on my computer or something?
well if you can get the ip then you can save the ip ... in alot of diffrent ways
Your siggy doesn't... right?
no my siggy doesn't that doens't mean I don't have the capability i could change the database back in it to just count the rows and store everyones IP as well as the AGENT string so that I have a basic idea of users viewing my sig ... {already apache does some of this for me by keeping track of browsers}
<?php

$filename = "ip_log";

$file = fopen($filename, "a")
fwrite($file, $_SERVER['REMOTE_ADDR'])
fclose($file)

?>


This might work...I haven't tested yet, but I will in just a minute. sweatdrop This just puts it into a plain text file.
Rannos
Well, you can write PHP in any plain text editor...a la Notepad.

As for the code, gimme a few minutes as I don't know how to do this off the top of my head.

Rannos
Thanks.. To all!
Rannos
<?php

$filename = "ip_log";

$file = fopen($filename, "a")
fwrite($file, $_SERVER['REMOTE_ADDR'])
fclose($file)

?>


This might work...I haven't tested yet, but I will in just a minute. sweatdrop This just puts it into a plain text file.
Thanks, but is there a way to make the code to save it in my computer or in the host?
crazy_guy27
Rannos
<?php

$filename = "ip_log";

$file = fopen($filename, "a")
fwrite($file, $_SERVER['REMOTE_ADDR'])
fclose($file)

?>


This might work...I haven't tested yet, but I will in just a minute. sweatdrop This just puts it into a plain text file.
Thanks, but is there a way to make the code to save it in my computer or in the host?

This saves it on the server in the directory that the file's located in. (You could change $filename to alter that a little). Also, I forgot an endline in there, change the fwrite() line to:
fwrite($file, $_SERVER['REMOTE_ADDR'] . "\n")
so it prints each address on a new line.

Hope that helps,
Rannos
Macromedia Dreamweaver. i got the whole deal there
I'll be back later to check the posts
Rannos
crazy_guy27
Rannos
<?php

$filename = "ip_log";

$file = fopen($filename, "a")
fwrite($file, $_SERVER['REMOTE_ADDR'])
fclose($file)

?>


This might work...I haven't tested yet, but I will in just a minute. sweatdrop This just puts it into a plain text file.
Thanks, but is there a way to make the code to save it in my computer or in the host?

This saves it on the server in the directory that the file's located in. (You could change $filename to alter that a little). Also, I forgot an endline in there, change the fwrite() line to:
fwrite($file, $_SERVER['REMOTE_ADDR'] . "\n")
so it prints each address on a new line.

Hope that helps,
Rannos
Thanks a lot!

Quick Reply

Submit
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum