No response as catch errors when sending a command through php api.
in delphi do so:
if Res.Trap then
mem.Lines.Add('Trap: ' + ROS.LastError)
in php is not as
<?php
//require('routeros_api.class.php');
require './routeros_api.class';
$API = new routeros_api();
$API->debug = true;
if ($API->connect('192.168.1.1', 'admin', '123')) {
$API->comm("/ppp/secret/add", array(
"name" => "user",
"password" => "pass",
"remote-address" => "172.16.1.10",
"comment" => "{new VPN user}",
"service" => "pptp",
));
// this is where I want to capture if an error occurs
//example delphi
if Res.Trap then
echo="Error ".ROS.LastError)
$API->disconnect();
}
?>
I just want a response from the fault name.
excuse my English, I use google translator