Dancer-Plugin-FakeCGI

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

examples/cgi-bin/CGI_pm_customize.pl
examples/cgi-bin/CGI_pm_diff_upload.pl
examples/cgi-bin/CGI_pm_file_upload.pl
examples/cgi-bin/CGI_pm_frameset.pl
examples/cgi-bin/CGI_pm_internal_links.pl
examples/cgi-bin/CGI_pm_javascript.pl
examples/cgi-bin/CGI_pm_monty.pl
examples/cgi-bin/CGI_pm_multiple_forms.pl
examples/cgi-bin/CGI_pm_nph-clock.pl
examples/cgi-bin/CGI_pm_nph-multipart.pl
examples/cgi-bin/CGI_pm_popup.pl
examples/cgi-bin/CGI_pm_save_state.pl
examples/cgi-bin/CGI_pm_tryit.pl
examples/cgi-bin/test.sh
examples/cgi-bin/test_CGI_file.pl
examples/cgi-bin/test_cookie.pl
examples/cgi-bin/test_env.pl
examples/cgi-bin/test_redirect.pl
examples/config.yml
examples/lib/CGI/test_CGI.pm
examples/lib/CGI/test_CGI_die.pm

examples/cgi-bin/CGI_pm_clickable_image.pl  view on Meta::CPAN

print $query->start_html("A Clickable Image");
print <<END;
<H1>A Clickable Image</H1>
</A>
END
print "Sorry, this isn't very exciting!\n";

print $query->start_form;
print $query->image_button('picture', "CGI_pm/wilogo.gif");
print "Give me a: ",
  $query->popup_menu('letter', ['A', 'B', 'C', 'D', 'E', 'W']), "\n";    #
print "<P>Magnification: ",
  $query->radio_group('magnification', ['1X', '2X', '4X', '20X']), "\n";
print "<HR>\n";

if ($query->param) {
    print "<P>Magnification, <EM>", $query->param('magnification'), "</EM>\n";
    print "<P>Selected Letter, <EM>", $query->param('letter'), "</EM>\n";
    ($x, $y) = ($query->param('picture.x'), $query->param('picture.y'));
    print "<P>Selected Position <EM>($x,$y)</EM>\n";
}

examples/cgi-bin/CGI_pm_customize.pl  view on Meta::CPAN

  textfield(
    -name    => 'name',
    -default => $preferences{'name'},
    -size    => 30
  ),
  br,

  table(
    TR( td("Preferred"),
        td("Page color:"),
        td( popup_menu(
                -name    => 'background',
                -values  => \@colors,
                -default => $preferences{'background'}
            )
        ),
    ),
    TR( td(''),
        td("Text color:"),
        td( popup_menu(
                -name    => 'text',
                -values  => \@colors,
                -default => $preferences{'text'}
            )
        )
    ),
    TR( td(''),
        td("Font size:"),
        td( popup_menu(
                -name    => 'size',
                -values  => \@sizes,
                -default => $preferences{'size'}
            )
        )
    )
  ),

  submit(-label => 'Set preferences'), hr;

examples/cgi-bin/CGI_pm_frameset.pl  view on Meta::CPAN

        -TARGET => "response"
    );
    print "What's your name? ", $query->textfield('name');
    print "<P>What's the combination?<P>",
      $query->checkbox_group(
        -name   => 'words',
        -values => ['eenie', 'meenie', 'minie', 'moe']
      );

    print "<P>What's your favorite color? ",
      $query->popup_menu(
        -name   => 'color',
        -values => ['red', 'green', 'blue', 'chartreuse']
      ),
      "<P>";
    print $query->submit;
    print $query->endform;
}

sub print_response {
    print "<H1>Frameset Result</H1>\n";

examples/cgi-bin/CGI_pm_internal_links.pl  view on Meta::CPAN

#!/usr/local/bin/perl

use CGI;
$query = new CGI;

# We generate a regular HTML file containing a very long list
# and a popup menu that does nothing except to show that we
# don't lose the state information.
print $query->header;
print $query->start_html("Internal Links Example");
print "<H1>Internal Links Example</H1>\n";
print
  "Click <cite>Submit Query</cite> to create a state.  Then scroll down and",
  " click on any of the <cite>Jump to top</cite> links.  This is not very exciting.";

print "<A NAME=\"start\"></A>\n";    # an anchor point at the top

# pick a default starting value;
$query->param('amenu', 'FOO1') unless $query->param('amenu');

print $query->start_form;
print $query->popup_menu('amenu', [('FOO1' .. 'FOO9')]);
print $query->submit, $query->endform;

# We create a long boring list for the purposes of illustration.
$myself = $query->self_url;
print "<OL>\n";
for (1 .. 100) {
    print qq{<LI>List item #$_ <A HREF="$myself#start">Jump to top</A>\n};
}
print "</OL>\n";

examples/cgi-bin/CGI_pm_javascript.pl  view on Meta::CPAN

      ),
      "<p>\n";
    print "Sex: ",
      radio_group(
        -name    => 'gender',
        -value   => [qw/male female/],
        -onClick => "doPraise(this)"
      ),
      "<p>\n";
    print "Hair color: ",
      popup_menu(
        -name     => 'color',
        -value    => [qw/brunette blonde red gray/],
        -default  => 'red',
        -onChange => "checkColor(this)"
      ),
      "<p>\n";
    print hidden(-name => 'age', -value => 0);
    print submit();
    print end_form;
}

examples/cgi-bin/CGI_pm_monty.pl  view on Meta::CPAN

    );

    print "<P><EM>How far can they fly?</EM><BR>",
      $query->radio_group(
        -name    => 'how far',
        -Values  => ['10 ft', '1 mile', '10 miles', 'real far'],
        -default => '1 mile'
      );

    print "<P><EM>What's your favorite color?</EM>  ";
    print $query->popup_menu(
        -name    => 'Color',
        -Values  => ['black', 'brown', 'red', 'yellow'],
        -default => 'red'
    );

    print $query->hidden('Reference', 'Monty Python and the Holy Grail');

    print "<P><EM>What have you got there?</EM><BR>";
    print $query->scrolling_list(
        -name   => 'possessions',

examples/cgi-bin/CGI_pm_multiple_forms.pl  view on Meta::CPAN

print "<H1>Multiple Forms</H1>\n";

# Print the first form
print $query->start_form;
$name = $query->remote_user || 'anonymous@' . $query->remote_host;

print "What's your name? ", $query->textfield('name', $name, 50);
print "<P>What's the combination?<P>",
  $query->checkbox_group('words', ['eenie', 'meenie', 'minie', 'moe']);
print "<P>What's your favorite color? ",
  $query->popup_menu('color', ['red', 'green', 'blue', 'chartreuse']),
  "<P>";
print $query->submit('form_1', 'Send Form 1');
print $query->endform;

# Print the second form
print "<HR>\n";
print $query->start_form;
print "Some radio buttons: ",
  $query->radio_group('radio buttons', [qw{one two three four five}], 'three'),
  "\n";

examples/cgi-bin/CGI_pm_popup.pl  view on Meta::CPAN

    print $query->start_form(-target => '_new');
    print "What's your name? ", $query->textfield('name');
    print "<P>What's the combination?<P>",
      $query->checkbox_group(
        -name   => 'words',
        -values => ['eenie', 'meenie', 'minie', 'moe'],
        -defaults => ['eenie', 'moe']
      );

    print "<P>What's your favorite color? ",
      $query->popup_menu(
        -name   => 'color',
        -values => ['red', 'green', 'blue', 'chartreuse']
      ),
      "<P>";
    print $query->submit;
    print $query->endform;

}
else {
    print "<H1>And the Answer is...</H1>\n";

examples/cgi-bin/CGI_pm_save_state.pl  view on Meta::CPAN

print $query->start_html("Save and Restore Example");
print "<H1>Save and Restore Example</H1>\n";

# Here's where we take action on the previous request
&save_parameters($query) if $query->param('action') eq 'SAVE';
$query = &restore_parameters($query) if $query->param('action') eq 'RESTORE';

# Here's where we create the form
print $query->start_multipart_form;
print "Popup 1: ",
  $query->popup_menu(
    'popup1', [qw{red green purple magenta orange chartreuse brown}]
  ),
  "\n";
print "Popup 2: ",
  $query->popup_menu(
    'popup2', [qw{lion tiger bear zebra potto wildebeest frog emu gazelle}]
  ),
  "\n";
print "<P>";
$default_name = $query->remote_addr . '.sav';
print "Save/restore state from file: ",
  $query->textfield('savefile', $default_name), "\n";
print "<P>";
print $query->submit('action', 'SAVE'), $query->submit('action', 'RESTORE');
print "<P>", $query->defaults;
print $query->endform;

examples/cgi-bin/CGI_pm_tryit.pl  view on Meta::CPAN

print start_html('A Simple Example'),
  h1('A Simple Example'),
  start_form,
  "What's your name? ", textfield('name'), p, "What's the combination?", p,
  checkbox_group(
    -name   => 'words',
    -values => ['eenie', 'meenie', 'minie', 'moe'],
    -defaults => ['eenie', 'minie']
  ),
  p, "What's your favorite color? ",
  popup_menu(
    -name   => 'color',
    -values => ['red', 'green', 'blue', 'chartreuse']
  ),
  p,
  submit,
  end_form,
  hr;

if (param()) {
    print "Your name is: ", em(param('name')),

examples/cgi-bin/test_CGI_file.pl  view on Meta::CPAN

    print start_html($name),
      h1($name),
      start_form,
      "What's your name? ", textfield('name'), p, "What's the combination?", p,
      checkbox_group(
        -name   => 'words',
        -values => ['eenie', 'meenie', 'minie', 'moe'],
        -defaults => ['eenie', 'minie']
      ),
      p, "What's your favorite color? ",
      popup_menu(
        -name   => 'color',
        -values => ['red', 'green', 'blue', 'chartreuse']
      ),
      p,
      submit,
      end_form,
      hr;

    if (param()) {
        print "Your name is: ", em(param('name')),

examples/lib/CGI/test_CGI.pm  view on Meta::CPAN

    print start_html($name),
      h1($name),
      start_form,
      "What's your name? ", textfield('name'), p, "What's the combination?", p,
      checkbox_group(
        -name   => 'words',
        -values => ['eenie', 'meenie', 'minie', 'moe'],
        -defaults => ['eenie', 'minie']
      ),
      p, "What's your favorite color? ",
      popup_menu(
        -name   => 'color',
        -values => ['red', 'green', 'blue', 'chartreuse']
      ),
      p,
      submit,
      end_form,
      hr;

    if (param()) {
        print "Your name is: ", em(param('name')),

examples/lib/CGI/test_CGI_OOP.pm  view on Meta::CPAN

      $q->h1($name),
      $q->start_form,
      "What's your name? ", $q->textfield('name'), $q->p,
      "What's the combination?", $q->p,
      $q->checkbox_group(
        -name   => 'words',
        -values => ['eenie', 'meenie', 'minie', 'moe'],
        -defaults => ['eenie', 'minie']
      ),
      $q->p, "What's your favorite color? ",
      $q->popup_menu(
        -name   => 'color',
        -values => ['red', 'green', 'blue', 'chartreuse']
      ),
      $q->p,
      $q->submit,
      $q->end_form,
      $q->hr;

    if ($q->param()) {
        print "Your name is: ", $q->em($q->param('name')),

examples/lib/CGI/test_CGI_die.pm  view on Meta::CPAN

    print start_html($name),
      h1($name),
      start_form,
      "What's your name? ", textfield('name'), p, "What's the combination?", p,
      checkbox_group(
        -name   => 'words',
        -values => ['eenie', 'meenie', 'minie', 'moe'],
        -defaults => ['eenie', 'minie']
      ),
      p, "What's your favorite color? ",
      popup_menu(
        -name   => 'color',
        -values => ['red', 'green', 'blue', 'chartreuse']
      ),
      p,
      submit,
      end_form,
      hr;

    warn "Testing warn";
    die "Testing die";

examples/lib/CGI/test_CGI_mocked.pm  view on Meta::CPAN

    print start_html($name),
      h1($name),
      start_form,
      "What's your name? ", textfield('name'), p, "What's the combination?", p,
      checkbox_group(
        -name   => 'words',
        -values => ['eenie', 'meenie', 'minie', 'moe'],
        -defaults => ['eenie', 'minie']
      ),
      p, "What's your favorite color? ",
      popup_menu(
        -name   => 'color',
        -values => ['red', 'green', 'blue', 'chartreuse']
      ),
      p,
      submit,
      end_form,
      hr;
    &test_param();
    print end_html;
}

examples/public/CGI_pm/WORLD_WRITABLE/18.157.1.253.sav  view on Meta::CPAN

popup1=purple
popup2=potto
savefile=18.157.1.253.sav
action=SAVE
=

examples/views/left.tt  view on Meta::CPAN

	<a href="/CGI_pm_customize.pl" target=right >customize</a><br />
	<a href="/CGI_pm_diff_upload.pl" target=right >diff_upload</a><br />
	<a href="/CGI_pm_file_upload.pl" target=right >file_upload</a><br />
	<a href="/CGI_pm_frameset.pl" target=right >frameset</a><br />
	<a href="/CGI_pm_internal_links.pl" target=right >internal_links</a><br />
	<a href="/CGI_pm_javascript.pl" target=right >javascript</a><br />
	<a href="/CGI_pm_monty.pl" target=right >monty</a><br />
	<a href="/CGI_pm_multiple_forms.pl" target=right >multiple_forms</a><br />
	<a href="/CGI_pm_nph-clock.pl" target=right >nph-clock</a><br />
	<a href="/CGI_pm_nph-multipart.pl" target=right >nph-multipart</a><br />
	<a href="/CGI_pm_popup.pl" target=right >popup</a><br />
	<a href="/CGI_pm_save_state.pl" target=right >save_state</a><br />
	<a href="/CGI_pm_tryit.pl" target=right >tryit</a><br />
<% END %>



( run in 2.889 seconds using v1.01-cache-2.11-cpan-364913b4093 )