Dev Posted August 29, 2012 Share Posted August 29, 2012 (edited) Hey, So, I've been trying to make this example work on the wiki page for PHP SDK, I have Apache 2.2 and PHP 5.3 installed and successfully running on my PC, I also have the PHP SDK files in my htdocs folder of Apache along with this new call.php file I just created, but for some reason it is only returning 'nil'. If someone has any idea or past experiences with SDK, please help me out. -- call.lua function result(sum) if sum ~= "ERROR" then outputDebugString(tostring(sum)) end end function phpCall( ) callRemote ( "localhost:80/call.php", result, 12, 16 ) end addCommandHandler("call", phpCall) // call.php <html> <body> <?php include( "mta_sdk.php" ); $input = mta::getInput(); mta::doReturn($input[0] + $input[1]); ?> </body> </html> Edited August 29, 2012 by Guest Link to comment
Scripting Moderators Sarrum Posted August 29, 2012 Scripting Moderators Share Posted August 29, 2012 I tested, it works. maybe, try this: <?php include( "mta_sdk.php" ); $input = mta::getInput(); mta::doReturn($input[0] + $input[1]); ?> Link to comment
Dev Posted August 29, 2012 Author Share Posted August 29, 2012 Ah yea, works now! thanks mate. I thought the html and body tags were necessary. Link to comment
Scripting Moderators Sarrum Posted August 29, 2012 Scripting Moderators Share Posted August 29, 2012 My pleasure. 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