A little experience in developing CGI in C ++ Builder

Source: Internet
Author: User
Tags php source code

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.