None of the 3 methods I've tried (based on various threads I've read) seem to work. Help appreciated. And I'll admit I'm a total newb with this stuff.
Here' the ahk:
#SingleInstance ; 1st method /* ErrorLevel = 999 RunWait, C:\php\php.exe getVPIP.php 5, ,Hide UseErrorLevel MsgBox, Result: %ErrorLevel% */ ; 2nd method /* ret1 := CMDret("C:\php\php.exe getVPIP.php 5") MsgBox, Result: *%ret1%* CMDret(CMD) { VarSetCapacity(StrOut, 10000) RetVal := DllCall("cmdret.dll\RunReturn", "str", CMD, "str", StrOut) Return, %StrOut% } */ ; 3rd method CMDout= CMDerr= ProgramName := "C:\php\php.exe getVPIP.php 5" Ret := RunWaitEx(ProgramName, NULL, TextIn, CMDout, CMDerr) MsgBox, Return Value: %Ret% `r`n`r`nStdError: `r`n%CMDerr%`r`nStdOutput: `r`n%CMDout% RunWaitEx(CMD, CMDdir, CMDin, ByRef CMDout, ByRef CMDerr) { VarSetCapacity(CMDOut, 100000) VarSetCapacity(CMDerr, 100000) RetVal := DllCall("cmdret.dll\RunWEx", "str", CMD, "str", CMDdir, "str", CMDin, "str", CMDout, "str", CMDerr) Return, %RetVal% }
And here's the PHP (super simple):
<? $inputVar = $argv[1]; // perform logic based on input, then return value // trying 3 different methods to return a value echo 3; return 4; exit(5); ?>