2004-12-28 19:12 Beginning to find information online, ask questions: Q: How is the generated "verification code" program on the website implementation? Can c could not be implemented? Answer 1: Need to solve two problems: 1. Generate the CGI 2 of the GIF picture. Random number random number is simple? Generate the GIF's use libgd. Add the database, do it yourself, OVER. Q: Can a few big brothers upstairs can explain white spots, what is GD? Library function under Linux? Is it the system itself or? A: Google's first, then I will not give you the address. Or FreeBSD is good, Ports is too convenient. Hey. Libgd is a set of C language library functions, can be programmed directly with C language. From this aspect You don't need Apache PHP at all. But obviously your topic is required to provide pictures for other web calls, that is at least to install Apache. Then write CGI with CGI. As for the production of random variables, you have to Keep in touch with the client, allow the client to confirm the number and return to you, you can still think that this random number is what you arouse, who is generated, this is the so-called session. Because http is not kept connected The agreement is broken. This session is implemented with a file, or use the database, it is involved in something. Annoy. So if you are learning, if you use PHP, etc. Specialized web language. Q: I still want to ask how the functions in libgd use, there is an introduction. There is also the Assiss Elf King, "HTTP is not maintaining the agreement, it is broken," How does the session identify the client? A: Give someone reply to the post, come here, see if you have help you: session technology is actually very simple, its appearance is to solve the problem of HTTP does not maintain the connection (there is a bad thing is bad). Think general As follows: When the client sends an application to the server side, the server sends a sessionID to the client, to ensure that this sessionID will not repeat within a certain period of time (repeating it), later the client sends a request to the server. Time, bring this sessionID (you can use get, post, or cookie, depending on how the server is thinking) so that the server side can identify which client is identified by this sessionID. Then the server can read this sessionID Take relevant data, you can present files, you can also exist in the database, cassels you. Q: Oh, that is the "ID = ?????" in the URL address. If the customer sends a request for the server for the second time when communicating with the server, it will bring this sessionID. If the customer turns off this page and re-open a page to the server, the server will re-generate it. A sessionid.