Raised This Month: $51 Target: $400
 12% 

Solved Whats wrong with this login system?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TFZMistery
Junior Member
Join Date: Jul 2013
Old 02-19-2019 , 14:24   Whats wrong with this login system?
Reply With Quote #1

Hi, i have a problem with my login system. The problem is that variablese User[id] and Password[id] get somehow shared with everyone on the server. Im trying to fix it for several hours but i can figure it out. Can someone help?

Here is video showcasing the problem + amxx plugins + meta list

https://www.youtube.com/watch?v=xJ_1TmC5luk

I dont care that i showed MySQL login, its setup only for testing, i will delete that account after this is solved.
Thanks for any help!

PHP Code:
//deleted 

Last edited by TFZMistery; 02-22-2019 at 18:24. Reason: Solved
TFZMistery is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-19-2019 , 21:58   Re: Whats wrong with this login system?
Reply With Quote #2

You are using the variable 'Password' as if it were an array of strings but it's not, it's just a single dimension array. There are other variables where you make the same mistake. An array of strings would be declared like this:

szMyArrayOfStrings[MAXPLAYERS+1][64]

where 64 indicates a maximum string length of 63 characters.

Also, anywhere you need the maximum length of the string for this variable you would need to use charsmax(szMyArrayOfStrings[])
__________________

Last edited by fysiks; 02-19-2019 at 22:00.
fysiks is offline
TFZMistery
Junior Member
Join Date: Jul 2013
Old 02-20-2019 , 06:23   Re: Whats wrong with this login system?
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
You are using the variable 'Password' as if it were an array of strings but it's not, it's just a single dimension array. There are other variables where you make the same mistake. An array of strings would be declared like this:

szMyArrayOfStrings[MAXPLAYERS+1][64]

where 64 indicates a maximum string length of 63 characters.

Also, anywhere you need the maximum length of the string for this variable you would need to use charsmax(szMyArrayOfStrings[])
That solved the issue, thank you so much

TFZMistery is offline
Reply



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 17:15.


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