Draw a simple picture of a web client, web server, and show that the cgi program runs on the web server.
When client uses URL which specifies a cgi program, the web server recognizes that it is a cgi program based off of its extension .cgi or .php3. Instead of displaying the file it runs the program and displays the programs output. The output of the program should be htmlized.
What languages can we use to make a cgi program?
http://your.server/test.php3?var1=Hello&var2=5
< FORM ACTION="test.php3" METHOD="POST" >
< INPUT TYPE=text NAME=var >
< INPUT TYPE=submit >
< /FORM>
<?php_track_vars?>
<?
print "Values submitted via POST method:<br>";
/* reset() rewinds the given array's internal ptr to first elem */
reset($HTTP_POST_VARS);
/* list() - isn't really a function, assigns a list of
vars in one operation, in this case each returns a
key, value pair which list is assigning to $key and
$val */
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
print "$key => $val<br>";
}
?>