Hi,
I want to test a tcp server using PHP. Is there a way to get the value of my ip without hardcoding it? So that i can test it from another computer without changing the ip everytime my server ip changes ?
How to get value of my dynamic ip?
Moderator: General Moderators
-
kabuki1985
- Forum Commoner
- Posts: 32
- Joined: Thu Jun 15, 2006 10:19 pm
Put this online somewhere like http://www.mydomain.com/myscript.php:
Then, in your script:
I think that would work. I've not tested it.
Code: Select all
<?php echo $_SERVER['REMOTE_ADDR']; ?>Code: Select all
<?php $myIP = file_get_contents("http://www.mydomain.com/myscript.php"); ?>