3ventic Posted May 25, 2012 Share Posted May 25, 2012 I'm trying to use the MTA PHP API to establish a connection to get data from the MTA server. When call() (or callfunction()) is used, it throws HTTP error 401 (Access denied), and on the MTA server console, it says HTTP: 'mta' entered correct password from [iP] $mtaQ = new mta('128.204.203.182', 22005, 'mta', [correct password here]); $resource = $mtaQ->getResource('CheckQuery'); // Exists and is running on the MTA server. $mtaInfo_str[] = $resource->call('getPlayerInfo'); // Is an exported server-side function within CheckQuery The script is on the same IP (and VPS) with the server and I've been trying a bunch of other ways to do it (using $mtaInfo_str as non-array, calling with callfunction() instead of call, leaving login info out, etc.), but it seems I've run into a dead end. Any help? Link to comment
Anderl Posted May 25, 2012 Share Posted May 25, 2012 Are the username and password correct? Link to comment
3ventic Posted May 26, 2012 Author Share Posted May 26, 2012 Username and password are correct and the MTA server account has the same pass and user as the FTP used. Link to comment
AeroXbird Posted May 26, 2012 Share Posted May 26, 2012 Perhaps because the resource name is case sensitive and you made a typo? Link to comment
3ventic Posted May 26, 2012 Author Share Posted May 26, 2012 The name of the resource matches the folder name and meta.xml. Link to comment
50p Posted May 27, 2012 Share Posted May 27, 2012 Make sure your function is exported as an http function. Link to comment
3ventic Posted May 27, 2012 Author Share Posted May 27, 2012 Make sure your function is exported as an http function. Fixed it, thanks. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now