I need help regarding PHP! -
WildOne - 22.07.2014
Well basically i relaunched my server and it saves user data based on
.ini
And interestingly i found a user
CP that works with .ini and uses FTP (Great)!
But the problem is i'm a noob with PHP! and really frustrated! When i use the Demo.ini file to login through php it works!
but when i use my server .ini file e.g player.ini it dosent work! So i am looking forward to any expert who can help!
Well i gathered up the Things that you need in case to judge what i am asking so here they are:
The User CP link:
https://sampforum.blast.hk/showthread.php?tid=517282
Then this is the Demo.ini file i use and it basically works:
Код:
ID = 1
Password = "c53323891c805766b5465dfb1f511a8fb216d30ad0e3fb690aab6e75ee3819706f92f1f8cca58245ca5672213a42f38a8f8f60c302021ce5497b3087e6b049fe"
Admin = 6
VIP = 0
Money = 0
Score = 0
Skin = 0
RegDate = "6/3/2014"
Then this is how my server saves the files in .ini format (player.ini)
Код:
Key=kknlЃђON
Level=1AdminLevel=0
Band=0
PermBand=0
Warnings=0
Boombox=0
AlreadyBoombox=0
Disabled=0
DonateRank=0BanAppealer=0
Undercover=0
DJ=1
TogReports=0
Radio=0
RadioFreq=0
UpgradePoints=0
ConnectedTime=2
Registered=1
Sex=1
Age=18
Origin=0
Muted=0
Respect=1
Money=74200
Bank=20019
Crimes=0
Accent=0
CHits=0
FHits=0
Arrested=0
Phonebook=0
LottoNr=0
Fishes=0
BiggestFish=0
Job=0
Job2=0
Paycheck=18250
HeadValue=0
Jailed=0
JailTime=0
WRestricted=0
Materials=10000
BriefCase=0
BCash=0
BCrack=0
BPot=0
BMats=0
Packages=0
Crates=0
Pot=10
Crack=10
Leader=0
Member=0
Division=0
FMember=255
Rank=6
DetSkill=401
SexSkill=0
BoxSkill=0
LawSkill=0
MechSkill=0
JackSkill=0
CarSkill=0
TruckSkill=0
NewsSkill=0
DrugsSkill=0
ArmsSkill=401
SmugglerSkill=0
FishSkill=0
FightingStyle=0
pHealth=100.0
pArmor=100.0
pSHealth=0.5
Int=0
Local=255
VirtualWorld=0
HouseInvite=0
Model=115
Clothes=0
PhoneNr=0
Apartment=-1
Apartment2=999
When i log in using my server .ini file it says error couldnt log in! im sure i need to change something in the PHP script but im not that good in PHP! so if anyone would help i would really be greatfull!
However thanks in advance! And please can someone also tell me how to connect my server FTP with this script!
Want to add me on skype: xjizzy_jx
Re: I need help regarding PHP! -
Kaperstone - 22.07.2014
You can't connect to the FTP with a script but you need a software for this.
FileZilla is a good one for file managing.
Plus post it in the release thread then,opening a new one won't benefit you in any way, becuase nobody else knows the code better than the publisher.
I am not going to dig into this, but make sure you placed the website folder in the right place and that both server and website have an access to it.
Re: I need help regarding PHP! -
GWMPT - 22.07.2014
Quote:
Originally Posted by xkirill
You can't connect to the FTP with a script but you need a software for this.
|
He meant connecting the php script to the FTP server(if not mistaken)
Re: I need help regarding PHP! -
WildOne - 23.07.2014
Quote:
Originally Posted by Kikito
He meant connecting the php script to the FTP server(if not mistaken)
|
Yes that's what im talking about
Re: I need help regarding PHP! -
Mark_Weston - 23.07.2014
Here is an example:
https://sampforum.blast.hk/showthread.php?tid=101773
Good luck ;p
Re: I need help regarding PHP! -
mamorunl - 23.07.2014
Isn't it kinda logical that you cannot login? You don't even have a password defined in your ini file.
Re: I need help regarding PHP! -
Vince - 23.07.2014
I think "Key" is meant to be the password. But it seems to be using some random no-good hash. Hell, it might even be plain text.
Re: I need help regarding PHP! -
Sinner - 23.07.2014
Theres a few problems with the script you are using which is, in my opinion, very poorly made.
1) It relies on fixed keys (Id, Password, Admin), instead of reading the keys you have in your player.ini file. So you'll need to change ucp.php so it'll read your own keys and not the ones from the demo file (Key, Level, AdminLevel, Band, PermBand, Warnings, Boombox, AlreadyBoombox, Disabled, ...).
Change:
PHP код:
$user['Password'] = $file->get(null, 'Password');
$user["Money"] = $file->get(null, 'Money');
$user["Score"] = $file->get(null, 'Score');
$user["Admin"] = $file->get(null, 'Admin');
$user["VIP"] = $file->get(null, 'VIP');
$user["Skin"] = $file->get(null, 'Skin');
$user["ID"] = $file->get(null, 'ID');
$user["RegOn"] = $file->get(null, 'RegDate');
2) ucp.php expects the password to be hashed using Whirlpool, the one you provided is just plain text. So either make sure your server hashes your passwords first (WP_Hash by ******), or change the script to use plain text, which is not recommended.
PHP код:
$hashed = hash('whirlpool', $password1);
3) This is not a good script, don't use it
Re: I need help regarding PHP! -
NewerthRoleplay - 23.07.2014
Give FractalBB a go if you wish, I've added support for FTP INI files and support for most encryption methods (not salts as of yet) and it's easy to add your own if you don't know how. If you have problems with it check (or post in) the main thread or pm me and I'll be glad to help!