Results 1 to 9 of 9

Thread: Finding Ip of FTPS

  1. #1
    Join Date
    Nov 2006
    Location
    portugal
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Finding Ip of FTPS

    hi:

    i'm new here and i don't know if i have posted right. I need a program that finds the current ip address from ftps. Can you help me? thanks in advanced. Maria

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Er, ping should do it -- it displays the IP of the host. Alternatively, a quick-and-dirty method in C:
    Code:
    #include <arpa/inet.h>
    #include <netdb.h>
    
    int main(int argc, char **argv) {
      struct hostent *host;
      if(argc != 2) {
        printf("Usage: %s <host>\n", argv[0]);
        exit(1);
      }
      if(!(host = gethostbyname(argv[1]))) {
        printf("Unable to look up host.\n");
        exit(2);
      }
      printf("%s\n", inet_ntoa(*((struct in_addr *)(host->h_addr))));
      return 0;
    }
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Nov 2006
    Location
    portugal
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well, i don't understand what i have to do to find the current ip address of a ftp. sorry!

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I would assume this is the same as your host. So... just look at your hosting account and find the IP.
    Or, you could use php. There's a function in that to display the current IP from which the script is running, I believe.

    ...Ok. Just checked on php.net

    Just make a new file, name it something.php and use this as it's contents:
    PHP Code:
    <?php echo $_SERVER['SERVER_ADDR']; ?>
    Use notepad or another text editor to do this. PHP is just like html, but also is first sent through a php processor on the server, and output as just html. When looking at the webpage's source, ALL you will see, then, is just the IP of the server, which will also be all that is displayed on the page.
    Note that you need php to be installed/working on your server for the script to run.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    If you are using Windows operating system go to the Command Prompt and type the following command

    ping your_ftps_server_domain_name and press enter key

    That will solve this.

  6. #6
    Join Date
    Nov 2006
    Location
    portugal
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    give me an example, please. thanks in advanced

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Go to Start->Run...
    Enter "command" and press enter or click OK. In the window that appears, if your server was ftps://www.example.com/, you would type:
    Code:
    C:\WINDOWS> ping /n 1 example.com
    The program will respond with something like:
    Code:
    PING example.com (192.0.34.166) 56(84) bytes of data.
    64 bytes from www.example.com (192.0.34.166): icmp_seq=1 ttl=44 time=152 ms
    
    --- example.com ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 152.800/152.800/152.800/0.000 ms
    Actual output may vary; this is from the linux-netkit variant of the utility. The text in red is the IP address of the server.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Nov 2006
    Location
    portugal
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    how do you find the ip adress of a dinamic ftp?

  9. #9
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    dynamic ftp? Never heard of that. Can you give an example?
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •