3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: MySQL dll
[Re: Captain_Kiyaku]
#41759
10/05/06 22:03
10/05/06 22:03
|
Joined: Apr 2006
Posts: 1,551 Netherlands
D3D
Serious User
|
Serious User
Joined: Apr 2006
Posts: 1,551
Netherlands
|
@ Kihaku: Tried to test the mysql dll and it works. Sounds like you make little mistake with the MySQL server, router, firewall setup to accept outside connections. Not all webhosts allow you to connect from anywhere else then localhost. Do your outside mysql database testing here --> Freesql.orgA lot of webhosts add a prefix to database names and usersnames, so then username becomes prefix_username. Remember if your behind a firewall and or router, you must allow access and port forward from there too. Dusty Code:
plugindir = ".";
//-------------------------------------------------------------------- // DLL-declarations //-------------------------------------------------------------------- dllfunction mySQL_Connectdb(w,x,y,z); // declaration of a DLL function dllfunction mySQL_Closedb(); dllfunction mySQL_ExecQuery(string); dllfunction mySQL_GetVal(x,y); dllfunction mySQL_GetStr(string,x,y); dllfunction mySQL_RowNumber(); dllfunction mySQL_IsConnected();
string output_text = [255]; //max 255 chars
text combatskills_txt { pos_x = 20; pos_y = 20; string = output_text; flags = visible; }
function main() { // database,host,user,password mySQL_Connectdb("dbname","www.freesql.org","dbuser","dbpass"); if(!mySQL_IsConnected()) { beep; exit; } str_cpy(output_text, "Connected!"); while(1) { wait(1); } }
|
|
|
MySQL dll - MD5 or SHA encryption
[Re: D3D]
#41760
10/08/06 22:20
10/08/06 22:20
|
Joined: Apr 2006
Posts: 1,551 Netherlands
D3D
Serious User
|
Serious User
Joined: Apr 2006
Posts: 1,551
Netherlands
|
I have a question about encryption. Do you have to add MD5 somewhere in the c-script if you send the password from the inkey to the mysql database server and the password on the server uses MD5 of SHA? Could anyone explain this? Code:
function userlogin() { mySQL_Connectdb("gsa6db","mydomain","gsa6","xs4all"); if(!mySQL_IsConnected()) { beep; exit; // Connection failed, exit to Windows. }
inkey(username); inkey(password);
str_cat(query, "select * from Players WHERE username='"); str_cat(query, username); str_cat(query, "' AND password='"); str_cat(query, password); str_cat(query, "';");
if(mySQL_ExecQuery(query)&&mySQL_RowNumber()==1){ // do something
}else{ exit; // No entry or false, exit to Windows. }
Dusty
|
|
|
Re: MySQL dll - MD5 or SHA encryption
[Re: D3D]
#41763
10/08/06 23:40
10/08/06 23:40
|
Joined: Sep 2005
Posts: 514 USA
Gho5tFac3K1llah
Developer
|
Developer
Joined: Sep 2005
Posts: 514
USA
|
|
|
|
Re: MySQL dll - MD5 and SHA encryption working!
[Re: D3D]
#41765
10/09/06 19:03
10/09/06 19:03
|
Joined: Apr 2006
Posts: 1,551 Netherlands
D3D
Serious User
|
Serious User
Joined: Apr 2006
Posts: 1,551
Netherlands
|
Looks like MD5 encryption is working if I change the code to: Code:
str_cat(query, "select * from Players WHERE gsa6user='"); str_cat(query, username); str_cat(query, "' AND gsa6password=MD5('"); str_cat(query, password); str_cat(query, "');");
Are you sure that encryption works straight away and I not need to change this in the c-script? Dusty
|
|
|
Re: MySQL dll - MD5 and SHA encryption working!
[Re: D3D]
#41766
10/09/06 20:29
10/09/06 20:29
|
Joined: Sep 2005
Posts: 514 USA
Gho5tFac3K1llah
Developer
|
Developer
Joined: Sep 2005
Posts: 514
USA
|
|
|
|
|