Objectives and Requirements:
(1) Through the Web query and set up the network parameters of the Development Board, require at least to query the IP address, subnet mask, Gateway, MAC address, you can set the automatic acquisition of IP or fixed IP, settings including the contents of the query
(2) using CGI programming +html for simple data interaction, regardless of style design
The development environment is Ubuntu14.04
This is an internship in the company to do a practiced hand small project. Perhaps it is in school habits, found that they do things always think of a little to do a little, adhering to the idea that the 1.1-point small function will eventually achieve the ultimate goal. However, the discovery of such benefits is the decomposition of the function is simple, the disadvantage is more obvious, because of the lack of overall planning in the process will find that sometimes these small functions of the implementation of the method may not be applicable, and even increase the difficulty of the overall implementation. So the first thing to learn is: Be sure to think before you start.
CGI and HTML are not previously contacted, but to thank the network of the Great God, CGI and HTML to use with the help of the BOA Server (Reference network implementation), the first to realize is the setup function, so the HTML obtained information in the CGI program part of the use of the command to execute ( Do in Ubuntu test) but found that this is not possible, considering that the CGI program can not modify the local network parameters (in the test to find that the changes failed) on a thread to send these settings parameters to local, in the local program to modify, so that the setup part has been resolved.
The display part is redirected in a file with the result of a query command locally, accessing the file in a CGI program to obtain query information.
Later thought to read and write to the configuration file can achieve this goal. Write the modification information directly to the configuration file of the network parameters when setting, and read the configuration information file directly when querying.
Learn to use CGI and HTML