Raised This Month: $ Target: $400
 0% 

Getting ip + port from file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
AwesomeMan
Member
Join Date: Jun 2013
Old 08-05-2013 , 11:00   Getting ip + port from file
Reply With Quote #1

Hello, I want to get ip + port from file into different variables.
By that I mean, i have a file called "ips.txt" and on first line, its:
1.1.1.1:27015
I want to get 1.1.1.1 into a variable let's say ip
and 27015 into variable port.
So ip = 1.1.1.1
port = 27015
Note that i will have more than one ip in file. an example:
1.1.1.1:27015
1.2.3.4:27055
PHP Code:
    new filepointer fopen(filename,"r")
    if(
filepointer)
    {
        new 
parsedip[32]
        new 
readdata[128]
        
        while(
fgets(filepointer,readdata,127))
        {
            
parse(readdata,parsedip,31)
        }
        
fclose(filepointer)
    } 
This is all i could get from reading tutorials.
AwesomeMan is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode