codeluaeveryday Posted March 31, 2013 Share Posted March 31, 2013 So, I am currently having a massive problem with my basic ass PHP code and you can't accuse me of being a retarded PHP newbie. It's quite basic, I am just getting server data and trying to load it to the webpage. <?php include( "mta_sdk.php" ); $hostname = "95.143.38.5"; $port = 22000; $username = "csmit195"; $password = "fuckyou"; $resourceName = "main"; $mtaServer = new mta( $hostname, $port, $username, $password ); $resource = $mtaServer->getResource ( $resourceName ); $returns[] = $resource->call ( "getServerStats" ); echo $returns[1]."/n"; echo $returns[2]."/n"; echo $returns[3]; ?> Notes to prevent questions: Yes thats the HTTP port, its shared with the server port. Yes the export function with the HTTP attribute is active. The actual '/main/call/getServerStats' is returning the correct data, so I'll work on another php file instead of using MTA SDK as its bugged and doesn't authenticate. Error: Fatal error: Uncaught exception 'Exception' with message 'Could not connect to 95.143.38.5:22000' in /home/a7765795/public_html/mta_sdk.php:146 Stack trace: #0 /home/a7765795/public_html/mta_sdk.php(79): mta->do_post_request('95.143.38.5', 22000, '/main/call/getS...', '') #1 /home/a7765795/public_html/mta_sdk.php(257): mta->callFunction('main', 'getServerStats', Array) #2 /home/a7765795/public_html/Sources/PortalBlocks.php(3561) : eval()'d code(12): Resource->call('getServerStats') #3 /home/a7765795/public_html/Sources/PortalBlocks.php(3561): eval() #4 /home/a7765795/public_html/Sources/Load.php(2170) : eval()'d code(222): sp_php(Array, '19') #5 /home/a7765795/public_html/Sources/Load.php(2170) : eval()'d code(139): template_block_curve(Array) #6 /home/a7765795/public_html/Sources/Load.php(2170) : eval()'d code(31): template_block(Array) #7 /home/a7765795/public_html/Sources/Load.php(1882): template_portal_above() #8 /home/a7765795/public_html/Sources/Subs.php(3402): loadSubTemplate('portal_above', true) #9 /home/a7765795 in /home/a7765795/public_html/mta_sdk.php on line 146 Thanks in advance fellow coders, Chris Smith 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