D
D
dsjohn2021-05-13 15:53:16
PHP
dsjohn, 2021-05-13 15:53:16

How to fix input error on nodejs?

connected a php script to a bot on nodejs and after the request it should give a link, but it only outputs for the previous message

var runner = require("child_process");
var phpScriptPath = "file.php";
var argsString = "value,value2,value";
runner.exec("php " + phpScriptPath + " " +argsString, function(err, phpResponse, stderr) {
 if(err) console.log(err); /* log error */
 const chatId = msg.chat.id;
bot.sendMessage(chatId, phpResponse );
});

in php just echo = $source;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dsjohn, 2021-05-14
@dsjohn

the script is correct, the error was in the logic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question