Raised This Month: $ Target: $400
 0% 

[ index out of bounds ]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Xablau
Member
Join Date: Dec 2014
Old 01-08-2015 , 20:29   [ index out of bounds ]
Reply With Quote #1

I have problem

Error: index out of bounds on line:
PHP Code:
parse(lines[i], line_variableSIZEline_valueSIZEline_value2SIZE
See my code:

PHP Code:
public client_putinserver(pid)
{
    new 
errorsendbuffer[512]

    
g_Socket socket_open("127.0.0.1"80SOCKET_TCPerror)
    
    
format(sendbuffer511"GET /web.php HTTP/1.1^nHost: 127.0.0.1^n^n")
        
    
socket_send(g_Socketsendbuffer511)
    
    const 
SIZE 63
    
new line_variable[SIZE 1], line_value[SIZE 1], line_value2[SIZE 1]
    
    if (
socket_change(g_Socket))
    {
        new 
lines[30][100], count 0
        socket_recv
(g_Socketg_Data1024)
        
count ExplodeString(lines50119g_Data13)
        for(new 
i=0;i<count;i++)
        {
            
parse(lines[i], line_variableSIZEline_valueSIZEline_value2SIZE)

            
// 100 lines in web.php ...
            // Continue...
        
}   
    }
    
socket_close(g_Socket)
    return 
PLUGIN_CONTINUE;
}
stock ExplodeStringp_szOutput[][], p_nMaxp_nSizep_szInput[], p_szDelimiter ) { // Function by xeroblood
    
new nIdx 0strlen(p_szInput)
    new 
nLen = (copycp_szOutput[nIdx], p_nSizep_szInputp_szDelimiter ))
    while( (
nLen l) && (++nIdx p_nMax) )
        
nLen += (copycp_szOutput[nIdx], p_nSizep_szInput[nLen], p_szDelimiter ))
    return 
nIdx

lines[30][100] to lines[100][100] not work.

In web.php have 100 lines:
"Value 1" "Value 2" "Value 3"

How to Fix problem?

Last edited by Xablau; 01-08-2015 at 20:33.
Xablau 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:31.


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