Mini PHP Project - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21) +---- Thread: Mini PHP Project (/showthread.php?tid=21882) |
RE: Mini PHP Project - DeFacto - 09-04-2011 Just reads the IP address and source I came from?? Anyway, at least the song is pretty RE: Mini PHP Project - BreShiE - 09-04-2011 And the time aswell, but still need to sort that out. RE: Mini PHP Project - Orgy - 09-04-2011 (09-04-2011, 07:00 AM)BreShiE Wrote: And the time aswell, but still need to sort that out. You're not going to be able to accurately get the time for each user using PHP. Not without having them tell you their timezone, at least. JavaScript might work, though. RE: Mini PHP Project - FritoBandito - 09-04-2011 Actually, The time() function in PHP grabs the time of the server it is hosted on. In this case, it is showing 3:15 pm for me because the server is hosted in the eastern time zone while I am in the Central time zone. It is a good start to learn PHP. Getting the persons IP address is also quite simple. 2 Lines of code can simple get your IP address and display it: Code: <?php Basic as that. But i do like the skull head btw RE: Mini PHP Project - BreShiE - 09-04-2011 (09-04-2011, 12:17 PM)FritoBandito Wrote: Actually, The time() function in PHP grabs the time of the server it is hosted on. In this case, it is showing 3:15 pm for me because the server is hosted in the eastern time zone while I am in the Central time zone. It is a good start to learn PHP. The "skull head" is the troll face, how didn't you know that? Also you can cut that down to one line as I did. PHP Code: <?php RE: Mini PHP Project - alabama - 09-04-2011 You should make the clock count by the seconds. Instead of having to refresh the page to see the time change. RE: Mini PHP Project - FritoBandito - 09-04-2011 (09-04-2011, 01:37 PM)BreShiE Wrote: The "skull head" is the troll face, how didn't you know that? lol my bad. Wasn't paying that much attention... And that works too, but what if you want to use the $ip variable later on? :O. Like....to make a logger on who comes on your website. (09-04-2011, 01:41 PM)alabama Wrote: You should make the clock count by the seconds. Instead of having to refresh the page to see the time change. Or use javascript . RE: Mini PHP Project - Orgy - 09-04-2011 (09-04-2011, 01:50 PM)FritoBandito Wrote: lol my bad. Wasn't paying that much attention... Then you can still use $_SERVER['REMOTE_ADDR'] ;) RE: Mini PHP Project - .edit - 09-04-2011 Really simple. I'm learning PHP and this is similar to my first project. I made an IP logging script which added it to a mysql database. RE: Mini PHP Project - Orgy - 09-04-2011 (09-04-2011, 05:13 PM).edit Wrote: Really simple. I think everyone starts with an IP logging script. Not a bad thing, really; if you make a half-decent one, you can learn quite a bit. |