Dev Posted August 29, 2012 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 "First they ignore you, then they laugh at you, then they fight you, then you win." - Mahatma Gandhi (1869-1948)
Moderators Sarrum Posted August 29, 2012 Moderators 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]); ?>
Dev Posted August 29, 2012 Author Posted August 29, 2012 Ah yea, works now! thanks mate. I thought the html and body tags were necessary. "First they ignore you, then they laugh at you, then they fight you, then you win." - Mahatma Gandhi (1869-1948)
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