Community discussions

MikroTik App
 
zlJabel
just joined
Topic Author
Posts: 1
Joined: Tue Jun 01, 2021 2:04 am

Help code APi nat move  [SOLVED]

Tue Jun 01, 2021 2:07 am

hello I'm trying to make the code to move through php work but this does not give me an error, but it does not make the correct movement either, the idea is that through the code they move the nat rules from one side to the other
<?php 
	require('RouterosAPI.php');
 	require('ip.php');
$orden1= $_REQUEST["orden1"];
$orden2= $_REQUEST["orden2"];
  	$API = new RouterosAPI();
    $API->debug = false;
$data = new StdClass();
 	if ($API->connect($ip,$user,$pw)) {
       $API->write("/ip/firewall/nat/move",false);
       $API->write($orden1,false);
       $API->write('=destination='.$orden2,true);
       $READ = $API->read(false);
       $ARRAY = $API->parseResponse($READ);
               $API->disconnect();
        }
?>   
replace code for :D
solved thanks
 $API->write('=numbers='.$orden1,false); 

Who is online

Users browsing this forum: Bing [Bot], diamuxin, GoogleOther [Bot] and 22 guests