Values Carried Between Pages : Page « CGI « Perl






Values Carried Between Pages

    


#!/usr/bin/perl -T

use strict;
use CGI qw/:standard/;

print header;

if (param('color')) {
   print start_html('Hello'),
         "Hello ", param('name'),p,
         "Your favorite color is: ",param('color'),p,
         hr;
}
elsif (param('name')) {
  print start_html('Hello'),
  "Hello ",
  param('name'),
  p,
  start_form,
  "Please enter your favorite color: ",textfield('color'),
  hidden(-name=>'name',-value=>param('name')),
  submit,
  end_form,
  hr;

} else {
  print start_html('Hello'),
  start_form,
  "Enter your name: ",textfield('name'),
  submit,
  end_form,
  hr;
}

print end_html;

exit;

   
    
    
    
  








Related examples in the same category

1.Track the number of times a web page has been accessed
2.Redirect a web page
3.Redirect page
4.Page counter
5.Logs visitors to web site
6.Server push