I’m trying and learn to create php API …
im add setting menu interfaces, ip address , dns , gateaway , userman , NAT , n maybe other menu …
but i’m having trouble at setting DHCP Server(include pool and dhcp network) …
anyone have idea or php script about dhcp-server ??
What exactly are you having problems with? What have you tried?
It should be almost as easy as in terminal. In other words, if you need to add a pool and network, you need to add them separately, but that’s about the only “complication”.
i try n learn to create web controller with input method sir … n this my script for submit button … is it possible to execute 3 API command in one submit button ??
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…
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 ..
There are many ways to make the system more portable, but the easiest is to abstract away the settings.
Create a new PHP file, and in it, create constants and/or variables that contain the settings, such as the MikroTik hostname, username and password, and anything else your app may be using (database credentials, etc.). Include said file every time you use one of its settings.
When a different system uses it, it can just alter the file to contain the new system’s settings.
yep sir… for me the hardest part is sync user & pass on login .. Therefore, in every part of the PHP , im write manual login … I actually recently learned PHP (1 month) and I only understand in mikrotik system… because this is the final project of my college .. then inevitably I had to try it ..
very2 hard for me .. learn programming language in a short time and in a hurry .. because the field that I take is network engineering not programming
Well what do ya’ know . My API client (the one in my very first post that is) also ended up as my final (university, but still) project… though my degree is in programming, but yeah…