boen_robot:
Of course it is.
In this case, the problem you’re having is a PHP syntax error. You need to surround your inner “if” with brackets. And there’s also a missing “)” in the last comm() call.
Also… I don’t think there’s an “interface” argument in the pool creation.
Although not required, I’d also recommend you fix your quoting and indenting style…
So something like:
<?php
require "routeros_api.class.php";
$API = new routeros_api();
$API->debug = false;
if ($API->connect('192.168.88.1', 'admin', 'admin')) {
if ($_POST['apply']) {
$API->comm ("/ip/pool/add", array(
"name" => "pool-{$_POST['name']}",
"ranges" => $_POST['range']
));
$API->comm("/ip/dhcp-server/network/add", array(
"address" => $_POST['address'],
"gateaway" => $_POST['gateaway'],
"netmask" => "255.255.255.0"
));
$API->comm("/ip/dhcp-server/add", array(
"name" => $_POST['name'],
"interface" => $_POST['iface'],
"address-pool" => "pool-{$_POST['name']}"
));
}
$API->disconnect();
}
?>
sorry too late for reply sir .. my ISP have problem …
thanks u very much sir .. for correct my mistake .. u r very2 help me
My problem is fixed now .. my web setting 90% finished .. wanna made portable so can be taken anywhere ..