CGI Scripts

[ LiB ]

CGI scripts can be written in almost any language; what language they are written in depends on the programmer, and on and the server that's being used. A popular language used to program these types of scripts is Perl. Perl is an interpreted language much like ActionScriptit requires the Perl interpreter to run the script. This means that before you write up your script and put it on your server, make sure you have Perl installed somewhere up there.

Perl used to be a general-purpose scripting language for the UNIX platform, and now it's among the most popular CGI scripting languages on earth. If that doesn't motivate you to pick up some Perl later on, I don't know what will. Lucky for you, you won't have to write much of the utilities you would normally want to write. Why? Because most of these wheels have been invented already. You can find royalty-free scripts all over the Netjust do a quick search.

When data is submitted to the CGI script, it can be transferred in two ways: through a GET method or through a POST methodthese are part of the HTTP protocol and have to do with where in the HTTP request the data is stored, and in what format. The GET method allows all of the information to be passed on as environment variables that the CGI script can just load and move on. The only downfall to GET is that it's not the most secure method. POST does something similar but in a more secure wayto top that, POST allows you to send an unlimited amount of data, whereas the GET method allows you to send only a limited amount. The GET method is less secure than POST because the GET method transfers data as part of the Web address and POST transfers data through environment variables that can be seen by the Web surfer.

Take a look at Figure 13.5. It will help you understand how the GET and POST methods transfer information.

Figure 13.5. Understanding GET and POST methods

graphic/13fig05.gif


[ LiB ]


Game Development with ActionScript
Game Development with ActionScript
ISBN: 1592001106
EAN: 2147483647
Year: 2004
Pages: 162
Authors: Lewis Moronta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net