CGI-Programming

Receiving CGI-program arguments from the URL

Program hello1.cgi

#!/usr/bin/perl

use CGI qw(:standard);

$first_name = param ("fn");
$last_name = param ("ln");
$phone  = param ("ph");

print "content-type: text/html\n\n";


print "<HTML>\n",
      "<HEAD>\n",
      "<TITLE>Say Hello<\/TITLE>\n",
      "<\/HEAD>\n",
         
      "<BODY>\n",
         
      "<H2>Say Hello<\/H2>\n",
      "Hi $first_name!<P>\n",
      "Your details:<P>\n",
      "Name: $first_name $last_name<BR>\n",
      "Phone number: $phone\n",

      "<\/BODY>\n",
      "<\/HTML>\n";

To browse the Web page, use the URL:

http://tarshish.md.biu.ac.il/~samsona/cgi-bin/hello1.cgi?fn=Noa&ln=Maatuk&ph=4961
or
http://tarshish.md.biu.ac.il/~samsona/cgi-bin/hello1.cgi?fn=Yitav&ln=Glantz&ph=4961
etc.


Table of Contents.
Previous | Next.