Grand Canyon RP (Desert/Wild West Style)
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Not working code

4 posters

Go down

Not working code Empty Not working code

Post  Xalphox Mon Apr 28, 2008 11:45 pm

Code:
public iRegister(id, name, password)
{
    new buffer[512] = format(buffer, sizeof(buffer), "INSERT INTO irp_users(ip, name, password) VALUES %s, %s, %s", getPlayerIP(id) ,getPlayerName(id), password)
    gTmp = samp_mysql_query(buffer)
   
    samp_mysql_real_escape_string(gTmp, gTmp) // This stops SQL injection.
   
    if(!gTmp)
    {
        format(gTmp, sizeof(gTmp), "[InevitaRP] Failed to register user '%s.' (Reason: Unable to execute query. [Line 18]", getPlayerName(id))
       
        print(gTmp)
        SendClientMessage(id, 0xFF0000, gTmp)
    }
}

Any ideas?

Xalphox
Intermediate RP-er
Intermediate RP-er

Number of posts : 81
Age : 34
Woonplaats : is this a new type of disease?
Registration date : 2008-04-23

Character story
Character information:

http://www.ageofgaming.net

Back to top Go down

Not working code Empty Re: Not working code

Post  Paddy_Collins Tue Apr 29, 2008 12:09 am

What you using as server name?
Paddy_Collins
Paddy_Collins
RP God
RP God

Number of posts : 176
Woonplaats : Prossy-Land And JimmySucks-Land
Registration date : 2008-03-12

Back to top Go down

Not working code Empty Re: Not working code

Post  Xalphox Tue Apr 29, 2008 12:13 am

Paddy_Collins wrote:What you using as server name?

What has the server name got to do with it?

Xalphox
Intermediate RP-er
Intermediate RP-er

Number of posts : 81
Age : 34
Woonplaats : is this a new type of disease?
Registration date : 2008-04-23

Character story
Character information:

http://www.ageofgaming.net

Back to top Go down

Not working code Empty Re: Not working code

Post  Paddy_Collins Tue Apr 29, 2008 1:03 am

I meant the name u use to login in with Very Happy
Paddy_Collins
Paddy_Collins
RP God
RP God

Number of posts : 176
Woonplaats : Prossy-Land And JimmySucks-Land
Registration date : 2008-03-12

Back to top Go down

Not working code Empty Re: Not working code

Post  Xalphox Tue Apr 29, 2008 7:35 pm

Jonathon_Cruscoe, but it's fixed now.

The real_escape() simply converts invalid characters (eg. ', ` and ; which are most commonly used for SQL injection(password: lol'; DROP TABLE irp_users --)) to their ascii/utf8 codes.

Xalphox
Intermediate RP-er
Intermediate RP-er

Number of posts : 81
Age : 34
Woonplaats : is this a new type of disease?
Registration date : 2008-04-23

Character story
Character information:

http://www.ageofgaming.net

Back to top Go down

Not working code Empty Re: Not working code

Post  Jimmy_Hernandez Tue Apr 29, 2008 7:36 pm

duh...

I knew that...
Jimmy_Hernandez
Jimmy_Hernandez
Administrator

Number of posts : 279
Woonplaats : Oisterwijk - The Netherlands
Registration date : 2008-03-09

Character story
Character information: PD Sheriff (Leader) Jimmy Hernandez

https://nextgeneration2008.forumotion.com

Back to top Go down

Not working code Empty Re: Not working code

Post  Nglsk Wed Apr 30, 2008 12:10 am

LOL
Nglsk
Nglsk
Administrator

Number of posts : 81
Age : 30
Registration date : 2008-04-19

Character story
Character information:

Back to top Go down

Not working code Empty Re: Not working code

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum