Introduction: This is a detailed page for developing CGI in C ++ builder. It introduces PHP, related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 326972 'rolling = 'no'>
Perspiration... This experience is intended for beginners.
I do not have a deep understanding of PHP, so sometimes I have to turn to a handy development tool for CGI when I encounter a problem that cannot be solved by using PHP for a while, and the security and stability are also very easy to improve.ProgramIt's just dozens of KB, and the speed is still acceptable. If it is made into a DLL, the speed is also very fast.
1. There are two ways to obtain incoming data based on different page request methods:
1. If the POST method is used:
For example, a text box named tname exists in the submission form.
In C ++ builder, you should obtain the following information:
Ansistring S = request-> contentfields-> values [ansistring ("tname")];
Response-> content = s;
Response-> sendresponse ();
2. If the get method is used:
Example: URL request: http: // localhost/cgi-bin/xxx.exe/Reg? Abc= 123
In C ++ builder, you should obtain the following information:
Ansistring S = request-> queryfields-> values [ansistring ("ABC")];
Response-> content = s;
Response-> sendresponse ();
2. It is executable after compilationCodeOr prj. cgi can be used normally, and the security is virtually improved.
3. cgi developed using C ++ builder can respond to multiple different requests and use path identifiers to differentiate them. These paths are virtual and actually do not exist, it only exists in the current executable file, for example:
Http: // localhost/cgi-bin/prj.exe/photo? Id = 1
Http: // localhost/cgi-bin/prj.exe/document? Id = 2
...
This feature can be used to implement multiple processing tasks in one CGI. A small EXE file basically finishes all the work.
Love J2EE follow Java Michael Jackson video station JSON online tools
http://biancheng.dnbcw.info/php/326972.html pageno: 13